-
Notifications
You must be signed in to change notification settings - Fork 431
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
refactor(core/inputs): report focusPath on text spans ending with .text #5786
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
No changes to documentation |
// It's a bit ugly right here, but it's a rather simple way to support the Presentation tool without | ||
// having to change the PTE's internals. | ||
if ( | ||
focusPath.length === 3 && |
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.
Paraphrasing tommy, why is the length === 3
here? What does it means when it's 3
?
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.
It means that the path is pointing directly to a block child, i.e:
[{_key: 'xxx'}, 'children', {_key: 'yyy'}]
- where xxx is the block and yyy is the child.
Component Testing Report Updated Feb 19, 2024 11:19 AM (UTC)
|
…paths ending with .text
…Path on same length This will ensure that any external focusPath is compared with the relevant length of something visible in the editor. If there is something pointing further into an object, we don't care, because it's only relevant so far regarding setting focus in the editor.
f440bad
to
f784609
Compare
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.
Tested, seems to work really well 👍
Description
This will make the PT-input report the
focusPath
when the focus is on text spans ending withtext
so that the Presentation Tool can work out of the box without making any exceptions for the PT-input.With this change, we have a bi-directional mapping of focus with the forms and the presentation tool.
Note that this will not change the PTE
EditorSelection
which will continue reporting as before, it's only the studio-specificfocusPath
reporting that will be affected by this change.What to review
Testing
Notes for release