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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/edit-widgets/src/components/widget-area/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
Inserter as BlockInserter,
WritingFlow,
ObserveTyping,
BlockEditorKeyboardShortcuts,
} from '@wordpress/block-editor';
import { withDispatch, withSelect } from '@wordpress/data';

Expand Down Expand Up @@ -71,9 +72,12 @@ function WidgetArea( {
settings={ settings }
>
{ isSelectedArea && (
<Inserter>
<BlockInserter />
</Inserter>
<>
<Inserter>
<BlockInserter />
</Inserter>
<BlockEditorKeyboardShortcuts />
</>
) }
<SelectionObserver
isSelectedArea={ isSelectedArea }
Expand Down
2 changes: 2 additions & 0 deletions playground/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import '@wordpress/editor'; // This shouldn't be necessary

import { render, useState, Fragment } from '@wordpress/element';
import {
BlockEditorKeyboardShortcuts,
BlockEditorProvider,
BlockList,
WritingFlow,
Expand Down Expand Up @@ -49,6 +50,7 @@ function App() {
onChange={ updateBlocks }
>
<div className="editor-styles-wrapper">
<BlockEditorKeyboardShortcuts />
<WritingFlow>
<ObserveTyping>
<BlockList />
Expand Down