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

Fix: Widgets screen can not deselect a block #17851

Conversation

@jorgefilipecosta
Copy link
Member

jorgefilipecosta commented Oct 8, 2019

Description

Fixes: #17780

This PR adds behavior to unselect the current widget area (and as a consequence the selected block) when the gray area outside the widget areas is clicked.

How has this been tested?

I went to the widget screen.
I added some blocks.
I clicked on the gray area outside the widgets screen and verified the currently selected block got unselected.
I did some smoke tests on the widgets screen to check that there are no regressions.

@mapk

This comment has been minimized.

Copy link
Contributor

mapk commented Oct 16, 2019

Clicking outside in the gray area works great! I was hoping that a user would be able to click anywhere outside the block to deselect it as well. Here's a gif that shows clicking above/below works, but clicking inside the block area to the left/right of the block does not deselect it.

Screen Recording 2019-10-16 at 7 02 11 AM

@jorgefilipecosta jorgefilipecosta force-pushed the fix/widgets-screen-deselect-a-block-once-it-has-been-selected branch from 7461cc2 to 7f3dd3b Nov 14, 2019
@jorgefilipecosta

This comment has been minimized.

Copy link
Member Author

jorgefilipecosta commented Nov 14, 2019

Clicking outside in the gray area works great! I was hoping that a user would be able to click anywhere outside the block to deselect it as well. Here's a gif that shows clicking above/below works, but clicking inside the block area to the left/right of the block does not deselect it.

Hi @mapk, that was happening because of the way padding and margins previously worked. The good news is that there was a change in the block editor, and not the problem is not happening. The bad news is that the change break how widget screen margins worked. I am fixing the margins at #18528 (straightforward change). After the margins are fixed it should be possible to see that this PR works as expected.
It is also possible to test it right now by clicking on the white space at the side of the in area inserter and verify blocks.

@jorgefilipecosta jorgefilipecosta force-pushed the fix/widgets-screen-deselect-a-block-once-it-has-been-selected branch from 7f3dd3b to d90b268 Nov 15, 2019
@jorgefilipecosta jorgefilipecosta force-pushed the fix/widgets-screen-deselect-a-block-once-it-has-been-selected branch from d90b268 to 4454f44 Nov 25, 2019
@jorgefilipecosta jorgefilipecosta force-pushed the fix/widgets-screen-deselect-a-block-once-it-has-been-selected branch from 4454f44 to 56df76e Nov 25, 2019
@youknowriad

This comment has been minimized.

Copy link
Contributor

youknowriad commented Nov 26, 2019

Unrelated bug, when closing/opening widgets area, there's a delay for the areas to load:

  • There should be some kind of loading indicator on initial load
  • If the areas are already loaded (second time), they should be rendered directly.
@jorgefilipecosta jorgefilipecosta changed the title Fix: Widgets screen can not deselect a block once it's been selected. Fix: Widgets screen can not deselect a block Nov 26, 2019
@jorgefilipecosta jorgefilipecosta merged commit cc378e8 into master Nov 26, 2019
2 checks passed
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
@jorgefilipecosta jorgefilipecosta deleted the fix/widgets-screen-deselect-a-block-once-it-has-been-selected branch Nov 26, 2019
@youknowriad youknowriad added this to the Gutenberg 7.1 milestone Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.