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

Make it possible to delay drawing of widget decoration nodes #721

Closed
marijnh opened this Issue Nov 9, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@marijnh
Copy link
Member

marijnh commented Nov 9, 2017

Decorations are often created during state transactions, in order to keep them consistent with the state. Yet widget decorations are raw DOM nodes, which sometimes need event handlers that have access to the view, or might want to draw something in a way that depends on some view prop or DOM state.

It might be a good idea to allow widget decorations to be created with a draw callback, rather than a finished DOM node, and then call that to actually draw them, with the view as parameter, the first time they are added to the DOM.

@marijnh

This comment has been minimized.

Copy link
Member Author

marijnh commented Apr 17, 2018

@jhnsnc

This comment has been minimized.

Copy link

jhnsnc commented Feb 4, 2019

ProseMirror/rfcs#7 is now implemented. I believe we can close this issue.

Relevant docs in the latest release: https://prosemirror.net/docs/ref/#view.Decoration%5Ewidget

@marijnh

This comment has been minimized.

Copy link
Member Author

marijnh commented Feb 5, 2019

Indeed!

@marijnh marijnh closed this Feb 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment