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

Writing Flow: Shift + down-arrow key to select across spacer block selects one too many blocks #53674

Open
jasmussen opened this issue Aug 15, 2023 · 5 comments
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Type] Bug An existing feature does not function as intended

Comments

@jasmussen
Copy link
Contributor

When I press shift+down arrow across a spacer block, I select 3 blocks instead of two.

Steps to reproduce

  • Insert a paragraph, a spacer, then a paragraph
  • Set the caret in the middle of the first paragraph
  • Press Shift + Down arrow

Observe that three blocks get selected. As is shown in this GIF:

3 blocks selected

Test content:

<!-- wp:paragraph -->
<p>Paragraph 1 (spacer block below)</p>
<!-- /wp:paragraph -->

<!-- wp:spacer {"height":"20px"} -->
<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:paragraph -->
<p>(spacer block above) Paragraph 2</p>
<!-- /wp:paragraph -->
@jasmussen jasmussen added [Type] Bug An existing feature does not function as intended [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... labels Aug 15, 2023
@annezazu
Copy link
Contributor

Added to the writing experience tracking issue. Thank you!

@bangank36
Copy link
Contributor

bangank36 commented Aug 23, 2023

@jasmussen what is the expected behavior with the Spacer in between paragraphs? Thanks

  1. Expect to select 2 blocks on Shift ARROW press ARROW key twice to order to select 3 blocks
    Similar to the current behavior of the non-Spacers blocks
Image Button
Kapture 2023-08-23 at 16 00 17 Kapture 2023-08-23 at 16 02 11
  1. Expect to trigger the partial selection, skip the Spacer
Click to reveal

chrome-capture-2023-7-23 (1)

Update: sorry for the misleading recording, the new videos are recorded on latest trunk with the keystroke for demostration

@jasmussen
Copy link
Contributor Author

Right now selecting from part of a paragraph across another block such as an image and partially into another paragraph triggers a multi-selection.

So long as that's the case, the spacer should not be exempt from this basic interaction, and should be consistent. So I'd expect 1.

@bangank36
Copy link
Contributor

bangank36 commented Aug 23, 2023

Thoughts

I made some tests on the Editor and Spacer is skipped because of its empty content and its children are hidden from the DOM
image

Suggestion

I have suggestion for modifying the .components-resizable-box__handle

Below are the recordings with keystroke

Click to reveal
zero-height Spacer Spacer
Kapture 2023-08-23 at 16 04 22 Kapture 2023-08-23 at 16 03 21

26 Aug 2023

The opacity method did not work well on Firefox, seems like empty div will be skipped on selection regardless its visibility on Firefox, while Chrome and Safari are working as expected a56a45d

Chrome Sarari Firefox
Chrome Safari Firefox

@bangank36
Copy link
Contributor

bangank36 commented Aug 27, 2023

27 Aug 2023

2nd attempt on Spacer block by appending a BR tag inside Spacer edit, this works across browsers 3b15ce1

Chrome Sarari Firefox
Chrome 2 Safari 2 Firefox 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Type] Bug An existing feature does not function as intended
Projects
No open projects
Status: Punted to 6.5
Development

Successfully merging a pull request may close this issue.

3 participants