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

Add: Block editor keyboard shortcuts to the widget screen and the playground #16972

Conversation

jorgefilipecosta
Copy link
Member

Fixes: #16954

This PR adds the block editor keyboard shortcuts that allow for example selecting all blocks or deleting them to the widgets screen and the playground.

How has this been tested?

I went to the widgets screen I multi-selected some blocks, I verified pressing delete key removes the blocks. I went to the widgets screen I pressed cmd + A multiple times and I verified all the blocks were selected.
I repeated the same tests on the playground.

@jorgefilipecosta jorgefilipecosta added the [Feature] Widgets Screen The block-based screen that replaced widgets.php. label Aug 8, 2019
@youknowriad
Copy link
Contributor

I think there's something wrong with that component. It's probably not scoped properly. When you have multiple widgets areas and you try to mutli-select for instance, it multi selects all the widgets areas.

I think ideally, it should be scoped, which means it only impacts the block editor where the focus is.

@jorgefilipecosta jorgefilipecosta force-pushed the add/block-editor-keyboard-shortcuts-to-the-widgets-screen-and-playground branch from c41bc45 to 879c133 Compare August 9, 2019 11:18
@jorgefilipecosta
Copy link
Member Author

I think there's something wrong with that component. It's probably not scoped properly. When you have multiple widgets areas and you try to mutli-select for instance, it multi selects all the widgets areas.

I think ideally, it should be scoped, which means it only impacts the block editor where the focus is.

Hi @youknowriad nice catch I tested in 2019 theme and unfortunately missed the multiple editor's scenarios.

I applied a very simple fix, and now we only use shortcuts for the selected widget area. It looks like things work well now.

@youknowriad
Copy link
Contributor

youknowriad commented Aug 9, 2019

While this works and I think we can merge, I feel the component is still broken though and this is something we should instead fix in the component directly.

@jorgefilipecosta jorgefilipecosta merged commit 3787332 into master Aug 9, 2019
@jorgefilipecosta jorgefilipecosta deleted the add/block-editor-keyboard-shortcuts-to-the-widgets-screen-and-playground branch August 9, 2019 12:13
@jorgefilipecosta
Copy link
Member Author

I feel the component is still broken though and this is something we should instead fix in the component directly.

I agree the keyboard shortcut component allows children to be passed and if that happens it only listen to events in the children. I think this component should work the same way. I will give that approach a try, I did not follow it because we had this very simple "fix" that worked and I was not sure if I was missing something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Widgets Screen The block-based screen that replaced widgets.php.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Widgets Screen: Can't delete several blocks with Delete key
2 participants