Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stopEvent option to NodeView.createPlugin #232

Open
cgorrieri opened this issue Aug 10, 2021 · 0 comments
Open

Add stopEvent option to NodeView.createPlugin #232

cgorrieri opened this issue Aug 10, 2021 · 0 comments

Comments

@cgorrieri
Copy link
Contributor

Hello,

I have been trying to set up a NodeView for iframes so when the node is selected a panel hovers over it with the option to edit the attributes or directly paste a full iframe code. The panel shows but when I click in an input, the event seems to be bubbled up and the element rerenders and I lose the focus.

I tried with the example you provide with the speech, and it happens also when I remove the content from the spec (I also have to remove the contentDOM property in the NodeView plugin config).

Finally, I made it work by copying the node-view.ts from the core, uncommenting the stopEvent function, and changing it to:

stopEvent() {
  return this._selected;
}

This is working in my case but I am wondering if there is a more elegant solution that can be generalized.

I am not that proficient in ProseMIrror yet, I have tried to accomplish that with widget decorations but I couldn't make it work the way I wanted. So if you have suggestions on alternative implementations, please let me know.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant