mirror of https://github.com/halo-dev/halo
[release-2.17] fix: bubble menu not appearing when crossing lines in editor (#6283)
This is an automated cherry-pick of #6268 /assign ruibaby ```release-note 修复默认编辑器中跨行选择节点时冒泡菜单无法出现的问题 ```pull/6324/head v2.17.1
parent
34f789ec30
commit
226c5c3bfc
|
@ -1,6 +1,7 @@
|
||||||
import ColorBubbleItem from "@/extensions/color/ColorBubbleItem.vue";
|
import ColorBubbleItem from "@/extensions/color/ColorBubbleItem.vue";
|
||||||
import HighlightBubbleItem from "@/extensions/highlight/HighlightBubbleItem.vue";
|
import HighlightBubbleItem from "@/extensions/highlight/HighlightBubbleItem.vue";
|
||||||
import LinkBubbleButton from "@/extensions/link/LinkBubbleButton.vue";
|
import LinkBubbleButton from "@/extensions/link/LinkBubbleButton.vue";
|
||||||
|
import { RangeSelection } from "@/extensions/range-selection";
|
||||||
import { i18n } from "@/locales";
|
import { i18n } from "@/locales";
|
||||||
import type { EditorState } from "@/tiptap/pm";
|
import type { EditorState } from "@/tiptap/pm";
|
||||||
import { isActive, isTextSelection } from "@/tiptap/vue-3";
|
import { isActive, isTextSelection } from "@/tiptap/vue-3";
|
||||||
|
@ -56,7 +57,10 @@ const Text = TiptapText.extend<ExtensionOptions>({
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isTextSelection(selection)) {
|
if (
|
||||||
|
!isTextSelection(selection) &&
|
||||||
|
!(selection instanceof RangeSelection)
|
||||||
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue