Add an update method to custom mark views #197
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ocavue/prosemirror-view:mark-view-update"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add a new method
MarkView.update(), similar to existingNodeView.update().This can avoid DOM rebuilds for some expensive custom mark views (imagine a custom
linkmark view that needs to render the favicon and OG image).@ -1220,0 +1227,4 @@// When nothing matches, try to update the mark view at this position// in place, so a custom mark view can adapt to a changed mark without// re-creating its DOM.if (found < 0) {could you add an
&& this.index < this.top.children.lengthhere to avoid out-of-bounds access? (Which would be caught by theinstanceofcheck but could still cause deoptimization.)done.
Thanks!
Shall I tag a release or are you planning more PRs?
@marijn wrote in #197 (comment):
You can tag a release. I don’t have any planning PRs for now.
Done (1.42.0)