-
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
Make the shortcut provider optional #53942
Changes from 5 commits
a7151ed
88b69b2
ab7c07c
2a6247c
a94eb2d
0138f13
93537de
82a856b
687c653
96d4684
bd15218
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
*/ | ||
import { SlotFillProvider } from '@wordpress/components'; | ||
import { UnsavedChangesWarning } from '@wordpress/editor'; | ||
import { ShortcutProvider } from '@wordpress/keyboard-shortcuts'; | ||
import { store as noticesStore } from '@wordpress/notices'; | ||
import { useDispatch } from '@wordpress/data'; | ||
import { __, sprintf } from '@wordpress/i18n'; | ||
|
@@ -35,16 +34,14 @@ export default function App() { | |
} | ||
|
||
return ( | ||
<ShortcutProvider style={ { height: '100%' } }> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems like this code was relying on ShortcutProvider having a div. Not sure if we should not add a div, but if things work I guess we can keep this change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I think this height was there to ensure the editor was full height and the removal of the height is probably going to have the same effect. Of course checking that the site editor is still full height. |
||
<SlotFillProvider> | ||
<GlobalStylesProvider> | ||
<UnsavedChangesWarning /> | ||
<RouterProvider> | ||
<Layout /> | ||
<PluginArea onError={ onPluginAreaError } /> | ||
</RouterProvider> | ||
</GlobalStylesProvider> | ||
</SlotFillProvider> | ||
</ShortcutProvider> | ||
<SlotFillProvider> | ||
<GlobalStylesProvider> | ||
<UnsavedChangesWarning /> | ||
<RouterProvider> | ||
<Layout /> | ||
<PluginArea onError={ onPluginAreaError } /> | ||
</RouterProvider> | ||
</GlobalStylesProvider> | ||
</SlotFillProvider> | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should definitely not add more event names to this list. Ideally we should removing this bubbling entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're totally against this, the alternative would be to add a
ShortcutProvider
to theIframe
component to catch the keyboard shortcuts events. The problem though is that right nowShortcutProvider
also serves as a registry for event handlersuseShortcut
calls, so we need to have two kind of providers: