Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Expand selection on consecutive Meta+A presses #4600
See #4369. This PR only adds going straight to selecting all blocks, just like it does now block selection without input focus.
How Has This Been Tested?
Focus an Editable.
Annoying thing here is that
I like this a lot. I think we want this.
One thing that becomes slightly more apparent now that it's easier to select all, is that focus is set on the block ellipsis menu when selecting all blocks, which scrolls you all the way to the top if if selected all on a long document.
I know we have to set focus somewhere, and that particular niggle does not have to be addressed as part of this PR. Perhaps the answer to where we set focus, when multi selecting, can be found in this ticket.
Another thing related to that — when I set the cursor in a paragraph, ⌘A once, then twice, then press Escape to deselect all blocks, I still have the text selection from the paragraph before, but I can't use the arrow-keys anymore because focus is now on the canvas itself, no longer on that block. It feels like the ideal solution would be to set focus back to where it was — but probably the right solution would be to deselect that text so when you press Escape twice, everything is unselected. Would be a nice fix if easy.
One thing that seems to be a regression from master — if I don't have anything selected, ⌘A now selectes everything on the page using the browser selection model, it doesn't select blocks like it did before. Now you have to set focus inside a paragraph or editable and ⌘A twice to select all blocks using the keyboard.
Totally love this. Approving based on experience, I can't speak to the code other than "looks good".
A future enhancement to look at, perhaps as part of the navigation mode stuff Riad has been looking at, could be to restore the caret to the block it was in, when you press escape. I.e. you're in block 3, ⌘A selects all text in block 3, ⌘A again selects all blocks, escape takes you back to block 3 with the caret.
The code largely looks good and I really like this functionality!
I'd like a few small docs changes and some documentation/changes for the
is function which I feel is a scary/not clear name.
Otherwise looks good!