-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add: Block editor keyboard shortcuts to the widget screen and the playground #16972
Conversation
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. |
c41bc45
to
879c133
Compare
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. |
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. |
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. |
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.