Skip to content

Commit

Permalink
[release-2.17] fix: bubble menu not appearing when crossing lines in …
Browse files Browse the repository at this point in the history
…editor (#6283)

This is an automated cherry-pick of #6268

/assign ruibaby

```release-note
修复默认编辑器中跨行选择节点时冒泡菜单无法出现的问题
```
  • Loading branch information
halo-dev-bot authored Jul 5, 2024
1 parent 34f789e commit 226c5c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui/packages/editor/src/extensions/text/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import ColorBubbleItem from "@/extensions/color/ColorBubbleItem.vue";
import HighlightBubbleItem from "@/extensions/highlight/HighlightBubbleItem.vue";
import LinkBubbleButton from "@/extensions/link/LinkBubbleButton.vue";
import { RangeSelection } from "@/extensions/range-selection";
import { i18n } from "@/locales";
import type { EditorState } from "@/tiptap/pm";
import { isActive, isTextSelection } from "@/tiptap/vue-3";
Expand Down Expand Up @@ -56,7 +57,10 @@ const Text = TiptapText.extend<ExtensionOptions>({
return false;
}

if (!isTextSelection(selection)) {
if (
!isTextSelection(selection) &&
!(selection instanceof RangeSelection)
) {
return false;
}

Expand Down

0 comments on commit 226c5c3

Please sign in to comment.