Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix query block duplicate group block rename controls for WP 6.4 #55604

Merged
Prev Previous commit
Next Next commit
Inline util func and rename
  • Loading branch information
getdave committed Oct 25, 2023
commit eff631d4813d937d865934b9161a88aba766967e

This file was deleted.

8 changes: 3 additions & 5 deletions packages/block-editor/src/components/block-rename/modal.js
Original file line number Diff line number Diff line change
@@ -12,10 +12,8 @@ import { useInstanceId } from '@wordpress/compose';
import { __, sprintf } from '@wordpress/i18n';
import { useState } from '@wordpress/element';
import { speak } from '@wordpress/a11y';
/**
* Internal dependencies
*/
import { emptyString } from './empty-string';

const isEmptyString = ( testString ) => testString?.trim()?.length === 0;

export default function BlockRenameModal( {
blockName,
@@ -27,7 +25,7 @@ export default function BlockRenameModal( {

const nameHasChanged = editedBlockName !== blockName;
const nameIsOriginal = editedBlockName === originalBlockName;
const nameIsEmpty = emptyString( editedBlockName );
const nameIsEmpty = isEmptyString( editedBlockName );

const isNameValid = nameHasChanged || nameIsOriginal;