Skip to content

Commit

Permalink
Widget Editor: Fix: close button is not working (#65443)
Browse files Browse the repository at this point in the history
* Fix: close button is not working

* Remove unnecessary CSS

---------

Unlinked contributors: parthVataliya16.

Co-authored-by: PARTHVATALIYA <[email protected]>
Co-authored-by: draganescu <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: miminari <[email protected]>
  • Loading branch information
5 people authored Dec 12, 2024
1 parent f1f5988 commit 0ef8a35
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
7 changes: 0 additions & 7 deletions packages/edit-widgets/src/components/layout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@
}
}

.edit-widgets-layout__inserter-panel-header {
padding-top: $grid-unit-10;
padding-right: $grid-unit-10;
display: flex;
justify-content: flex-end;
}

.edit-widgets-layout__inserter-panel-content {
// Leave space for the close button
height: calc(100% - #{$button-size} - #{$grid-unit-10});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
/**
* WordPress dependencies
*/
import { Button, VisuallyHidden } from '@wordpress/components';
import { close } from '@wordpress/icons';
import { __experimentalLibrary as Library } from '@wordpress/block-editor';
import {
useViewportMatch,
__experimentalUseDialog as useDialog,
} from '@wordpress/compose';
import { useCallback, useRef } from '@wordpress/element';
import { useDispatch } from '@wordpress/data';
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
Expand All @@ -28,7 +25,6 @@ export default function InserterSidebar() {
return setIsInserterOpened( false );
}, [ setIsInserterOpened ] );

const TagName = ! isMobileViewport ? VisuallyHidden : 'div';
const [ inserterDialogRef, inserterDialogProps ] = useDialog( {
onClose: closeInserter,
focusOnMount: true,
Expand All @@ -42,21 +38,14 @@ export default function InserterSidebar() {
{ ...inserterDialogProps }
className="edit-widgets-layout__inserter-panel"
>
<TagName className="edit-widgets-layout__inserter-panel-header">
<Button
__next40pxDefaultSize
icon={ close }
onClick={ closeInserter }
label={ __( 'Close Block Inserter' ) }
/>
</TagName>
<div className="edit-widgets-layout__inserter-panel-content">
<Library
showInserterHelpPanel
shouldFocusBlock={ isMobileViewport }
rootClientId={ rootClientId }
__experimentalInsertionIndex={ insertionIndex }
ref={ libraryRef }
onClose={ closeInserter }
/>
</div>
</div>
Expand Down

1 comment on commit 0ef8a35

@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 0ef8a35.
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/12297736973
📝 Reported issues:

Please sign in to comment.