Skip to content

Commit

Permalink
Quote: show as active when deeply nested child block is selected (#59662
Browse files Browse the repository at this point in the history
)

Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
  • Loading branch information
3 people committed Mar 7, 2024
1 parent 2071a26 commit 99ec831
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions packages/block-library/src/quote/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,17 @@ export default function QuoteEdit( {

useMigrateOnLoad( attributes, clientId );

const hasSelection = useSelect( ( select ) => {
const { isBlockSelected, hasSelectedInnerBlock } =
select( blockEditorStore );
return hasSelectedInnerBlock( clientId ) || isBlockSelected( clientId );
}, [] );
const hasSelection = useSelect(
( select ) => {
const { isBlockSelected, hasSelectedInnerBlock } =
select( blockEditorStore );
return (
hasSelectedInnerBlock( clientId, true ) ||
isBlockSelected( clientId )
);
},
[ clientId ]
);

const blockProps = useBlockProps( {
className: classNames( className, {
Expand Down

0 comments on commit 99ec831

Please sign in to comment.