Skip to content

Commit

Permalink
Fix: Add dropdown menu props to ToolsPanel component
Browse files Browse the repository at this point in the history
  • Loading branch information
Sukhendu2002 committed Dec 17, 2024
1 parent fb06c23 commit 904da77
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/block-library/src/table-of-contents/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { tableOfContents as icon } from '@wordpress/icons';
import TableOfContentsList from './list';
import { linearToNestedHeadingList } from './utils';
import { useObserveHeadings } from './hooks';
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';

/** @typedef {import('./utils').HeadingData} HeadingData */

Expand Down Expand Up @@ -80,7 +81,7 @@ export default function TableOfContentsEdit( {
);

const { replaceBlocks } = useDispatch( blockEditorStore );

const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const headingTree = linearToNestedHeadingList( headings );

const toolbarControls = canInsertList && (
Expand Down Expand Up @@ -116,6 +117,7 @@ export default function TableOfContentsEdit( {
onlyIncludeCurrentPage: false,
} );
} }
dropdownMenuProps={ dropdownMenuProps }
>
<ToolsPanelItem
hasValue={ () => onlyIncludeCurrentPage !== false }
Expand Down

0 comments on commit 904da77

Please sign in to comment.