chore: diable context menu for empty text
This commit is contained in:
@@ -243,7 +243,7 @@ export function useCodemirror(
|
|||||||
if (from === to) return
|
if (from === to) return
|
||||||
const text = view.value?.state.doc.sliceString(from, to)
|
const text = view.value?.state.doc.sliceString(from, to)
|
||||||
const { top, left } = view.value?.coordsAtPos(from)
|
const { top, left } = view.value?.coordsAtPos(from)
|
||||||
if (text) {
|
if (text && text.trim()) {
|
||||||
invokeAction("contextmenu.open", {
|
invokeAction("contextmenu.open", {
|
||||||
position: {
|
position: {
|
||||||
top,
|
top,
|
||||||
|
|||||||
Reference in New Issue
Block a user