Skip to content

Commit

Permalink
Table of Contents block: remove editor-only wrapping div. (#40899)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZebulanStanphill committed May 8, 2022
1 parent d5d8954 commit 4b00633
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions packages/block-library/src/table-of-contents/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ import {
} from '@wordpress/block-editor';
import { createBlock, store as blocksStore } from '@wordpress/blocks';
import {
Disabled,
PanelBody,
Placeholder,
ToggleControl,
ToolbarButton,
ToolbarGroup,
} from '@wordpress/components';
import { __experimentalUseDisabled as useDisabled } from '@wordpress/compose';
import { useDispatch, useSelect } from '@wordpress/data';
import { __unstableStripHTML as stripHTML } from '@wordpress/dom';
import { renderToString, useEffect } from '@wordpress/element';
Expand Down Expand Up @@ -55,6 +55,7 @@ export default function TableOfContentsEdit( {
setAttributes,
} ) {
const blockProps = useBlockProps();
const disabledRef = useDisabled();

const listBlockExists = useSelect(
( select ) => !! select( blocksStore ).getBlockType( 'core/list' ),
Expand Down Expand Up @@ -285,13 +286,9 @@ export default function TableOfContentsEdit( {
return (
<>
<nav { ...blockProps }>
<Disabled>
<ol>
<TableOfContentsList
nestedHeadingList={ headingTree }
/>
</ol>
</Disabled>
<ol ref={ disabledRef }>
<TableOfContentsList nestedHeadingList={ headingTree } />
</ol>
</nav>
{ toolbarControls }
{ inspectorControls }
Expand Down

0 comments on commit 4b00633

Please sign in to comment.