Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove Tab label UI
  • Loading branch information
mikachan committed Feb 6, 2026
commit f921267973d068f55e96647e19f31c933d6ae031
25 changes: 2 additions & 23 deletions packages/block-library/src/tab/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,17 @@ import {
InspectorControls,
store as blockEditorStore,
} from '@wordpress/block-editor';
import { PanelBody, TextControl, CheckboxControl } from '@wordpress/components';
import { PanelBody, CheckboxControl } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { useDispatch } from '@wordpress/data';
import { decodeEntities } from '@wordpress/html-entities';

/**
* Internal dependencies
*/
import AddTabToolbarControl from './add-tab-toolbar-control';
import RemoveTabToolbarControl from './remove-tab-toolbar-control';
import slugFromLabel from './slug-from-label';

export default function Controls( {
attributes,
setAttributes,
tabsClientId,
blockIndex,
isDefaultTab,
} ) {
const { label } = attributes;

export default function Controls( { tabsClientId, blockIndex, isDefaultTab } ) {
const { updateBlockAttributes } = useDispatch( blockEditorStore );

return (
Expand All @@ -34,17 +24,6 @@ export default function Controls( {
<RemoveTabToolbarControl tabsClientId={ tabsClientId } />
<InspectorControls>
<PanelBody title={ __( 'Settings' ) }>
<TextControl
label={ __( 'Label' ) }
value={ decodeEntities( label ) }
onChange={ ( value ) => {
setAttributes( {
label: value,
anchor: slugFromLabel( value, blockIndex ),
} );
} }
__next40pxDefaultSize
/>
<CheckboxControl
label={ __( 'Default tab' ) }
checked={ isDefaultTab }
Expand Down
3 changes: 0 additions & 3 deletions packages/block-library/src/tab/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export default function Edit( {
clientId,
context,
isSelected,
setAttributes,
__unstableLayoutClassNames: layoutClassNames,
} ) {
const focusRef = useRef();
Expand Down Expand Up @@ -161,8 +160,6 @@ export default function Edit( {
return (
<section { ...innerBlocksProps }>
<Controls
attributes={ attributes }
setAttributes={ setAttributes }
tabsClientId={ tabsClientId }
blockIndex={ blockIndex }
isDefaultTab={ isDefaultTab }
Expand Down