-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: allow partial block selection #38892
Merged
Merged
Changes from all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
d765a15
Initial attempt
ellatrix 60457c3
Fix selection from bottom to top
ellatrix 06cc562
Ensure native selection spans multiple blocks
ellatrix 4a84339
Fix isSelected
ellatrix b4e5245
Fix ctrl+A
ellatrix 5d59308
Fix e2e tests
ellatrix a56eef6
Fix text color button
ellatrix a467c2d
Fix early return
ellatrix e0b5a9a
Prevent default behaviour for everything except Backspace and Delete
ellatrix 2eabf19
Polish
ellatrix 3f6a302
Fix forward delete
ellatrix 05bf622
Fix typo
ellatrix 19cc8d9
Avoid DOM checks
ellatrix 5516657
Fix unit test
ellatrix fb8db5a
Allow partial selection with shift + arrow keys
ellatrix f0047f3
Fix e2e tests
ellatrix 4f5ab5d
Further fixes
ellatrix 150b23f
Fix forward delete
ellatrix 4089e7a
Add Enter handling
ellatrix 21a7932
Remove lines, fix occasional selection failure
ellatrix 9485788
Stabilise new e2e tests
ellatrix b63e96d
Allow input over selection
ellatrix 243aea3
Remove obsolete comment
ellatrix 734bc92
Remove scroll to multi-selection
ellatrix 77d449f
Polish highlight and block select style.
jasmussen d999acc
Fix for Firefox
ellatrix eae5615
Fix keyboard nav for Firefox
ellatrix 8292c5a
Use getDefaultBlockName
ellatrix 3240d51
insert '' => remove
ellatrix 020bdfe
Simplify selection filling
ellatrix 1f890f3
Fix Firefox focus issue
ellatrix 78007ec
Fix e2e tests
ellatrix 5c6c5f3
Fix selection after merge
ellatrix 0096310
Move selection tracking to writing flow
ellatrix 722b640
Fix import
ellatrix 8c66742
Fix e2e test
ellatrix 85bdcd5
Separate click to select hook
ellatrix b6c9cdd
Fix keyboard selection with non rich text
ellatrix 6d3babf
Restrict filling in selection if block already has selection
ellatrix 81c5b85
Fix paste e2e test
ellatrix fa1cbf6
Fix race condition in e2e tests
ellatrix fd016d0
Allow partial selection with shift+click
ellatrix 8b0c80d
wip
ellatrix bd3b1f1
Fix selection issue after quote merge
ellatrix bc16541
Fix e2e tests
ellatrix f3e2242
wip
ellatrix ea4189f
Expand selection on Delete if content can't be merged
ellatrix 92cfa15
Refine
ellatrix 660e9ca
Polish
ellatrix 0219ce0
Revert firefox compat move
ellatrix a573615
Revert unnessary changes for this PR
ellatrix 07e13e7
Remove unnessary cloning
ellatrix 022f9fb
Fix typos
ellatrix aab3f6c
Move input handling to writing flow
ellatrix 8597e0f
Fix e2e test
ellatrix 88a848b
Add more comments
ellatrix dfc4cb2
Try removing duplicate code
ellatrix dfdcf59
Make e2e tests pass again
ellatrix 67a0c20
Remove raf hack
ellatrix 50d2407
Fix block first focus
ellatrix fb09ae3
Fix comments in e2e tests about raf
ellatrix f04a150
Fix shift+click selection and add e2e test
ellatrix dca35d9
Remove unnecessary code
ellatrix 593194b
Check to see which tests are failing without this
ellatrix ab19bcf
Check if this is still needed
ellatrix 347c6b7
Fix shift+click selection inside block
ellatrix 1659b37
Fix selection inside list and quote blocks
ellatrix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
227 changes: 0 additions & 227 deletions
227
packages/block-editor/src/components/block-list/use-block-props/use-multi-selection.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
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 makes blocks look partially selected, like so:
If we change this rule to the following instead, it appears to thread the needle for me:
.block-editor-block-list__block.is-multi-selected:not(.rich-text) {
What do you think?
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.
Yes, that seems better. Can we check it still provides the right result for quotes, lists, headings, etc?