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

Disable selection when resizing #17359

Merged
merged 5 commits into from
Sep 9, 2019
Merged

Conversation

swissspidy
Copy link
Member

Description

Fixes #17313.

Disables text and block selection when resizing items in the editor.

Not part of the ResizableBox component itself as it should also work in different contexts.

How has this been tested?

Tested by following the steps in #17313 and verifying that no accidental selection happens.

Screenshots

Demo Video: https://cloudup.com/cNrI6jKgDpl

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

@swissspidy swissspidy added [Feature] Media Anything that impacts the experience of managing media [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Feature] Block Multi Selection The ability to select and manipulate multiple blocks [Block] Spacer Affects the Spacer Block labels Sep 6, 2019
@swissspidy
Copy link
Member Author

It seems that the issue is a bit bigger because of BLOCK_SELECTION_INITIAL_STATE and how the blockSelection reducer uses it. For example, when I remove blocks via the REMOVE_BLOCKS action, state is set to BLOCK_SELECTION_INITIAL_STATE, which means selection will be enabled again - even if I didn't intend to.

@senadir
Copy link
Contributor

senadir commented Sep 8, 2019

this reintroduces bugs fixed by #17175 & #15884
can we possibly find a way to fix both of them? both here & on those PRs?

@swissspidy
Copy link
Member Author

@senadir Thanks for pointing to these PRs! I think that should be doable by not using BLOCK_SELECTION_INITIAL_STATE in the way it currently is (see my previous comment). Will test it out in a bit.

Copy link
Contributor

@senadir senadir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this PR and it works great without breaking other things, I have one comment but it shouldn't block this PR, and I don't have strong opinions about it.

@senadir senadir merged commit 96cadd0 into master Sep 9, 2019
@senadir senadir deleted the fix/resizing-toggle-selection branch September 9, 2019 16:57
@senadir senadir added this to the Gutenberg 6.5 milestone Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Spacer Affects the Spacer Block [Feature] Block Multi Selection The ability to select and manipulate multiple blocks [Feature] Media Anything that impacts the experience of managing media [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multi-selection doesn't get disabled while resizing
2 participants