-
-
Notifications
You must be signed in to change notification settings - Fork 316
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
enh: improve selection experience #1264
enh: improve selection experience #1264
Conversation
SystemChanger
commented
Jun 21, 2023
•
edited
Loading
edited
- Prevent 'floating' controls when their holder no longer exist
- Selection range matches component when it is selected (so we don't have to think about overlapping handlers)
|
||
const compContext = context[pluginName]; | ||
const container = compContext._container; | ||
core.setRange(container, 0, container, 0); |
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.
This code is a problem when entering text after selecting an image.
After the merge, this code will be removed.
Thank you for your contribution.!
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.
This change is crucial for my other PRs and is important for overall logic of selection - only one acceptable target at once (text, component or selection range). Such logic has a positive effect on many things - from removing flashing carriage on text to preventing overlapping handlers from different selection targets.
Are you talking about pressing text keys when there is a selected component? (that leads to text insertion to component figure
area)
If I get you right, this problem was already there. (but may have different steps to reproduce the problem, e.g. pressing left/right arrow keys to position on component figure from the text node at first).
This code just makes this problem more explicit, and I also get rid of it in the further PRs.
Does it get fixed with next PR: https://github.com/JiHong88/suneditor/pull/1267/commits ?
I've done some enhancements and fixes in PRs, that altered the current behavior of keyboard interaction with components (images, videos) and explicit setting range to component area is really important.
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.
I highly recommend including this code. Just a friendly reminder so you don't forget it when the time to work with PRs will come. @JiHong88