[6.x] Bard set selection/focus outline improvements#14336
Open
[6.x] Bard set selection/focus outline improvements#14336
Conversation
… handled with the pseudo content
…den briefly so it doesn't flicker back to the parent while focus settles.
…roup] to prevent focus drifting back to container
…prevent focus drifting back to container
…tline hidden briefly so it doesn't flicker back to the parent while focus settles." broken by the merge conflict
… outline will no longer be correct
…s outline will no longer be correct
jasonvarga
requested changes
Mar 24, 2026
Comment on lines
+78
to
+106
| addKeyboardShortcuts() { | ||
| const shortcuts = {}; | ||
| const type = this.type; | ||
|
|
||
| const isSetSelected = (state) => { | ||
| const { selection } = state; | ||
| return selection instanceof NodeSelection && selection.node.type === type; | ||
| }; | ||
|
|
||
| const blockCharacterKey = () => isSetSelected(this.editor.state); | ||
|
|
||
| // Letters a-z | ||
| for (let i = 97; i <= 122; i++) { | ||
| shortcuts[String.fromCharCode(i)] = blockCharacterKey; | ||
| } | ||
|
|
||
| // Numbers 0-9 | ||
| for (let i = 0; i <= 9; i++) { | ||
| shortcuts[String(i)] = blockCharacterKey; | ||
| } | ||
|
|
||
| // Common punctuation/symbols | ||
| [' ', '-', '=', '[', ']', '\\', ';', "'", ',', '.', '/', '`'].forEach( | ||
| (key) => (shortcuts[key] = blockCharacterKey), | ||
| ); | ||
|
|
||
| return shortcuts; | ||
| }, | ||
|
|
Member
There was a problem hiding this comment.
This is wrong. Looks like you somehow grabbed mid-way through this PR #14189.
The PR ended up being different so these lines shouldn't be here at all.
Contributor
Author
There was a problem hiding this comment.
Hmm, I have no idea how that happened! I've updated the file so it's the same as the v6 branch now
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 of the Problem
Bard set selections can be confusing because focus states are shifted around with JavaScript.
This is documented in issue #14185 where a video shows the blue outline shifting around.
What this PR Does
…dropdown so it's only shown around the set you're interacting withBefore Fixes
Here you can see the selection outline is frequently pushed to the outer set when interacting with inner elements
Before.mp4
After Fixes
The selection outline does not jump to outer sets, instead keeping on the current set you're working on
After.mp4
How to Reproduce
Set up a Bard field with a set that houses a replicator, that contains a button group, and a further replicator (just for testing some inception replicators)
Try the following to see how the outline behaves:
…in the inner replicator to access the dropdown. Currently, the outline selection will be pushed to the outer Bard field, which is misleading