-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
improve updateAttributes #5738
base: develop
Are you sure you want to change the base?
improve updateAttributes #5738
Conversation
|
✅ Deploy Preview for tiptap-embed ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
there is a single test failing .. but I don't know why |
Sorry @silenius if you update your branch now it should work. Our branch did not have passing tests |
✔️ |
Changes Overview
This is a second attempt (first was in #5154 ) to improve updateAttributes. The first version was broken because it didn't handled range selection properly.
Implementation Approach
The current updateAttributes updates all nodes of the passing typeOrName. It is problematic in some cases, for example imagine a FlexContainer extension which contains 1..n FlexItem (extension) children, and each FlexItem extension can also contain 1..n FlexContainer and so one. If we update, for example, some property (flex align, ...) of a FlexContainer, all FlexContainer parents are updated. This is because ProseMirror node.nodesBetween returns all nodes in the selection range, which includes nodes that cover it (don't know why...).
Checklist
Related Issues
#3545 #4466 #5154