Skip to content

Commit

Permalink
Use InspectorAdvancedControls and rename to Name attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
Soean committed Dec 12, 2023
1 parent d04b376 commit 7b2d768
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions packages/block-library/src/details/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
useInnerBlocksProps,
store as blockEditorStore,
InspectorControls,
InspectorAdvancedControls,
} from '@wordpress/block-editor';
import { useSelect } from '@wordpress/data';
import { PanelBody, TextControl, ToggleControl } from '@wordpress/components';
Expand Down Expand Up @@ -56,18 +57,20 @@ function DetailsEdit( { attributes, setAttributes, clientId } ) {
} )
}
/>
<TextControl
label={ __( 'Name' ) }
value={ name }
onChange={ ( newName ) =>
setAttributes( { name: newName } )
}
help={ __(
'When using the name attribute to assign the same name to a group of detail elements, only one element in the set is opened at a time.'
) }
/>
</PanelBody>
</InspectorControls>
<InspectorAdvancedControls>
<TextControl
label={ __( 'Name attribute' ) }
value={ name }
onChange={ ( newName ) =>
setAttributes( { name: newName } )
}
help={ __(
'When using the name attribute to assign the same name to a group of detail elements, only one element in the set is opened at a time.'
) }
/>
</InspectorAdvancedControls>
<details
{ ...innerBlocksProps }
open={ hasSelection || showContent }
Expand Down

0 comments on commit 7b2d768

Please sign in to comment.