Skip to content

Commit

Permalink
Inserter: Rename closeQuickInserter prop to onClose for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
yogeshbhutkar committed Dec 24, 2024
1 parent f595402 commit 1ac98fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/block-editor/src/components/inserter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class Inserter extends Component {
isAppender={ isAppender }
prioritizePatterns={ prioritizePatterns }
selectBlockOnInsert={ selectBlockOnInsert }
closeQuickInserter={ onClose }
onClose={ onClose }
/>
);
}
Expand Down
10 changes: 3 additions & 7 deletions packages/block-editor/src/components/inserter/quick-inserter.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function QuickInserter( {
isAppender,
prioritizePatterns,
selectBlockOnInsert,
closeQuickInserter,
onClose,
hasSearch = true,
} ) {
const [ filterValue, setFilterValue ] = useState( '' );
Expand Down Expand Up @@ -90,12 +90,8 @@ export default function QuickInserter( {
// When clicking Browse All select the appropriate block so as
// the insertion point can work as expected.
const onBrowseAll = () => {
if (
isMobileDevice &&
closeQuickInserter &&
typeof closeQuickInserter === 'function'
) {
closeQuickInserter();
if ( isMobileDevice ) {
onClose?.();
}

setInserterIsOpened( {
Expand Down

0 comments on commit 1ac98fb

Please sign in to comment.