Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(portable-text-editor): emit new selection on mark toggle (#4881)
* fix(portable-text-editor): always emit new selection when toggling marks Always emit a new selection when toggling marks, even though the selection might still end up be the same. This happens when there is only one span node in the editor and you toggle a mark on it. It is very convenient for implementations to use selection as a dependency for updating toolbars etc, so we should force a new selection here to support that dependency. Note that the selection value is still the same, it's just emitted as a new object. * test(portable-text-editor): add test for new selection object after toggling marks This will both test the actual selection object and if the change event is emitted with the correct value.
- Loading branch information
d91357f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
performance-studio – ./
performance-studio.sanity.build
performance-studio-git-next.sanity.build
d91357f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
test-studio – ./
test-studio.sanity.build
test-studio-git-next.sanity.build