Skip to content

Commit

Permalink
Allow resizing the sidebar in the site editor using keyboard (#47176)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored Jan 16, 2023
1 parent af82d1d commit e768804
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/edit-site/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,17 @@ export default function Layout( { onError } ) {
} }
handleComponent={ {
right: (
<ResizeHandle variation="separator" />
<ResizeHandle
direction="right"
variation="separator"
resizeWidthBy={ ( delta ) => {
setForcedWidth(
( forcedWidth ??
defaultSidebarWidth ) +
delta
);
} }
/>
),
} }
handleClasses={ undefined }
Expand Down
4 changes: 4 additions & 0 deletions packages/edit-site/src/components/layout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ $hub-height: $grid-unit-20 * 2 + $button-size;
min-height: 100%;
@include custom-scrollbars-on-hover;
}

.resizable-editor__drag-handle {
right: 0;
}
}

.edit-site-layout__canvas-container {
Expand Down

1 comment on commit e768804

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in e768804.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3930407071
📝 Reported issues:

Please sign in to comment.