Skip to content
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: Arrow Up/Down when all blocks multi-selected #5523

Closed
aduth opened this issue Mar 9, 2018 · 1 comment
Closed

Multi-Selection: Arrow Up/Down when all blocks multi-selected #5523

aduth opened this issue Mar 9, 2018 · 1 comment
Labels
[Feature] Block Multi Selection The ability to select and manipulate multiple blocks [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Type] Bug An existing feature does not function as intended

Comments

@aduth
Copy link
Member

aduth commented Mar 9, 2018

Regression of #3745

Steps to Reproduce:

  1. Create a new post
  2. Insert a few blocks
  3. Multi-select all of them
  4. Press Arrow Up or Arrow Down

Expected:

Focus transitions to the title (up) or default block appender (down).

Actual:

Nothing happens.

Implementation Suggestion:

This logic in WritingFlow needs to be made less specific to blocks and instead reuse getClosestTabbable (enhanced in #5513):

moveSelection( isReverse ) {
const { previousBlockUid, nextBlockUid } = this.props;
const focusedBlockUid = isReverse ? previousBlockUid : nextBlockUid;
if ( focusedBlockUid ) {
this.props.onSelectBlock( focusedBlockUid );
}
}

  1. Get block focus tab stop node for extent in direction (up? first in multi-selection, conscious of directionality of selection)
  2. this.getClosestTabbable( target, isReverse )
  3. placeCaretAtHorizontalEdge( closestTabbable, isReverse );
@aduth aduth added [Feature] Block Multi Selection The ability to select and manipulate multiple blocks [Type] Bug An existing feature does not function as intended labels Mar 9, 2018
@danielbachhuber danielbachhuber added this to the WordPress 5.0 milestone Jun 4, 2018
@mtias mtias added the [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... label Jul 17, 2018
@aduth
Copy link
Member Author

aduth commented Aug 9, 2018

Tested again. Now something does happen. It moves the caret to the first or last block for up or down respectively, which seems like a good behavior mimicking that of a horizontal selection collapsing.

@aduth aduth closed this as completed Aug 9, 2018
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 [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants