-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Multi-selection: avoid RichText instances becoming disabled after multi selection. #38821
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Size Change: +190 B (0%) Total Size: 1.15 MB
ℹ️ View Unchanged
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Feature] Block Multi Selection
The ability to select and manipulate multiple blocks
[Type] Bug
An existing feature does not function as intended
[Type] Code Quality
Issues or PRs that relate to code quality
[Type] Performance
Related to performance efforts
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently there's a bug where rich text instances become disabled after multi selection. I haven't found a way to consistently reproduce this, but the point is that the way we disable rich text instance for multi-selection and re-enable them afterwards is quite fragile.
There's two ways to get a native selection to work across instances:
contenteditable
attribute will allow you to expand selection outside of the borders of the currently focussed rich text instance. This is what we currently do.contenteditbale
wrapper around all rich text instances will natively allow you to expand selection outside of the borders of the currently focussed nested rich text instance.This PR explores the second approach, which would also be beneficial for future cross block selection.
The new approach is much simpler because instead of having to change attributes for every single rich text instance on the page, we only have to change the attribute on the writing flow wrapper, which should also perform better.
Testing Instructions
I find the bug is most easily reproducible in Safari. Open the demo content and multi select some blocks. Then delete the multi selection by clicking on another block. Check blocks further down the page to see if it's possible to place the caret in them. Some rich text areas will still be disabled. You may have to try several times to reproduce the issue.
With this PR, and following the steps above, the issue should be gone.
Screenshots
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).