Tiptap: BubbleMenu and FloatingMenu do not work now.

Created on 6 May 2019  路  13Comments  路  Source: ueberdosis/tiptap

Describe the bug
BubbleMenu and FloatingMenu does not work now. I do NOT know what's going on ? When I rewrite my editor, I notice that the basic plugins does not Work. I add some console.log() in its onUpdate() like the following:

// EditorMenuBubble.js 
 return editor.registerPlugin(MenuBubble({
                            element: this.$el,
                            keepInBounds: this.keepInBounds,
                            onUpdate: menu => {
                                console.log("on Update", menu);
                                // the second check ensures event is fired only once
                                if (menu.isActive && this.menu.isActive === false) {
                                    this.$emit('show', menu)
                                } else if (!menu.isActive && this.menu.isActive === true) {
                                    this.$emit('hide', menu)
                                }
                                this.menu = menu
                            },
                        }));

However, nothing happens in the output, selecting text do not trigger the menu to pop up. I try many times and can not figure it out. And further, I found the bubblemenu in live demo does not work too and the floating menu as well.

Steps to Reproduce / Codesandbox Example
Just open live examples, and select some text.

Screenshots
1222
May-06-2019 19-06-47

Environment

  • OS: macOS Mojave 10.14.3
  • Browse:

    • Chrome Version 73.0.3683.103 && 74.0.3729.131

    • Safari 12.0.3 (14606.4.5)

  • Version: Latest
  • Mobile / Desktop: Desktop
bug

All 13 comments

oh no! looking into it.

Hmm, this seems to be a bug with ProseMirror :(
You can follow up here.

Em, and I try this tooltip, not work too.

Yeah state.reconfigure() is not working anymore for view updates. This method is used for adding plugins after initializing the editor.

@philippkuehn Have you seen this ?

So reconfigure is not the true reason now... But the current code would cause plugins view() not work properly anyway, like the example you have just mentioned in Here

Argh I don't get it :/

Sorry for saying that. It's my mistake. Have you figure it out ??

Noo, I don't get it what's wrong. I don't changed anything there :D

Okay, still seems to be the same bug with prosemirror. I've created a codesandbox where you can reproduce this error.

having the same problem :(

It appears to be a breaking change between prosemirror-view 1.8.9 and 1.9.0. In this commit reconfigured appears to have been dropped as a parameter when updating plugin views.

I'm almost wondering if the way we were doing it before isn't rather hackish. The PM guide states plugins should be added when the state is created. A project I'm working on, I did a work around for this bug/change by adding a plugins:[] options to the Editor class, then merging it with the default plugins. That means plugins have to be added when the editor is created, but it's working fine in my scenario.

I have a PR for this issue. unless further change happens in prosemirror-view, the possible solution is to call updatePluginViews() manually, which works temporarily now. See #289 deploy preview

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dolbex picture dolbex  路  3Comments

winterdedavid picture winterdedavid  路  3Comments

chrisjbrown picture chrisjbrown  路  3Comments

afwn90cj93201nixr2e1re picture afwn90cj93201nixr2e1re  路  3Comments

jetacpp picture jetacpp  路  3Comments