fix: make shouldShow and pluginKey option for menus, fix #1779

This commit is contained in:
Philipp Kühn
2021-08-23 18:44:40 +02:00
parent 1618e8ee85
commit 70a328bd3d
4 changed files with 16 additions and 12 deletions

View File

@@ -8,7 +8,7 @@ export interface FloatingMenuPluginProps {
editor: Editor,
element: HTMLElement,
tippyOptions?: Partial<Props>,
shouldShow: ((props: {
shouldShow?: ((props: {
editor: Editor,
view: EditorView,
state: EditorState,
@@ -122,7 +122,7 @@ export class FloatingMenuView {
return
}
const shouldShow = this.shouldShow({
const shouldShow = this.shouldShow?.({
editor: this.editor,
view,
state,