Skip to content

Commit

Permalink
Restore effect
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Nov 18, 2024
1 parent ee49927 commit 853165c
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
store as blockEditorStore,
privateApis as blockEditorPrivateApis,
} from '@wordpress/block-editor';
import { useState } from '@wordpress/element';
import { useEffect, useState } from '@wordpress/element';
import { Button, Popover } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { next, previous } from '@wordpress/icons';
Expand All @@ -36,6 +36,13 @@ export default function CollapsibleBlockToolbar() {

const hasBlockSelection = !! blockSelectionStart;

useEffect( () => {
// If we have a new block selection, show the block tools
if ( blockSelectionStart ) {
setIsCollapsed( false );
}
}, [ blockSelectionStart ] );

if ( ! hasBlockToolbar ) {
return null;
}
Expand Down

0 comments on commit 853165c

Please sign in to comment.