mirror of https://github.com/fantasticit/think.git
tiptap: fix bubble menu blur when editing some node
This commit is contained in:
parent
b8a91a7d0c
commit
514873f31a
|
@ -11,11 +11,11 @@ export interface BubbleMenuPluginProps {
|
|||
shouldShow?:
|
||||
| ((props: {
|
||||
editor: Editor;
|
||||
view: EditorView;
|
||||
state: EditorState;
|
||||
view?: EditorView;
|
||||
state?: EditorState;
|
||||
oldState?: EditorState;
|
||||
from: number;
|
||||
to: number;
|
||||
from?: number;
|
||||
to?: number;
|
||||
}) => boolean)
|
||||
| null;
|
||||
renderContainerSelector?: string;
|
||||
|
@ -114,6 +114,14 @@ export class BubbleMenuView {
|
|||
return;
|
||||
}
|
||||
|
||||
const shouldShow =
|
||||
this.editor.isEditable &&
|
||||
this.shouldShow?.({
|
||||
editor: this.editor,
|
||||
});
|
||||
|
||||
if (shouldShow) return;
|
||||
|
||||
this.hide();
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue