-
Notifications
You must be signed in to change notification settings - Fork 432
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
feat(portable-text-editor): new API method getFragment #5806
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
No changes to documentation |
Component Testing Report Updated Feb 21, 2024 9:03 AM (UTC)
|
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.
Great API! Thanks @skogsmaskin
What happens when we have a selection across multiple blocks? Could we add a test considering that.
Also, does it work across different children in the same block?
Yes, it will be able to handle whatever selection is made in the editor and have that extracted to a fragment. I agree that this would be great to have represented in the tests. I can add it. |
This function will get the current selection in the editor as Portable Text fragment.
6c8ac88
to
b294421
Compare
@pedrobonamin - I've added a new test that tests across blocks and also with Inline objects among the children. |
Description
This function will get the current selection in the editor as a Portable Text fragment.
See the included test for how it works.
What to review
That the changes look good.
Testing
See test
Notes for release