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?:
|
shouldShow?:
|
||||||
| ((props: {
|
| ((props: {
|
||||||
editor: Editor;
|
editor: Editor;
|
||||||
view: EditorView;
|
view?: EditorView;
|
||||||
state: EditorState;
|
state?: EditorState;
|
||||||
oldState?: EditorState;
|
oldState?: EditorState;
|
||||||
from: number;
|
from?: number;
|
||||||
to: number;
|
to?: number;
|
||||||
}) => boolean)
|
}) => boolean)
|
||||||
| null;
|
| null;
|
||||||
renderContainerSelector?: string;
|
renderContainerSelector?: string;
|
||||||
|
@ -114,6 +114,14 @@ export class BubbleMenuView {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const shouldShow =
|
||||||
|
this.editor.isEditable &&
|
||||||
|
this.shouldShow?.({
|
||||||
|
editor: this.editor,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (shouldShow) return;
|
||||||
|
|
||||||
this.hide();
|
this.hide();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue