Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Make it possible to delay drawing of widget decoration nodes #721
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.
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