-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix selection shifting when deleting paragraphs on android #7239
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 think the ideal approach here is to come up with a solution that does not depend on setTimeout. This kind of solution causes a lot of trouble down the line with debugging, possibly creating extra history entries, etc. even when it does work.
@etrepum I agree with you that in a ideal world we would not need to use to use I see a few ways forward:
I personally think this is a significant bug, it would be good if we can resolve it in a timely manner. |
Approach 2 is preferable. I understand that you’ve spent a lot of time investigating, but this type of solution only makes things worse the next time something has to be investigated. Untangling the selection implicit state machine is something on my list but I can’t make any commitments on timing. As you know, this is not simple. |
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.
As far as I can tell with a Google Pixel 5 on Sauce Labs this build still has the bug
Turns out the fix was skipped over by an earlier optimisation in certain cases. It should be fixed now, and I have tested it on both Pixel and Samsung, and with the SwiftKey keyboard too. Thanks for helping to test this thoroughly. |
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 works with the Pixel and Samsung devices I tried on browser stack with the google, samsung and microsoft keyboards. Does anyone else want to give this a test before merge? /cc @zurfyx @potatowagon
Description
Fixes #4340
This is a second attempt to fix the abovementioned bug, following the unsuccessful attempt in #7122 (apologies for the issues introduced then)
In this PR, selection is only restored during deletion and when several other criteria have been met, this should minimise the chances of any unintended side effects.
Test plan
Before
screen-20250224-160048.mp4
After
screen-20250224-160326.mp4