diff --git a/package-lock.json b/package-lock.json index bdf466f383280..d335a46f0f3c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17175,7 +17175,8 @@ "lodash": "^4.17.21", "memize": "^1.1.0", "react-autosize-textarea": "^7.1.0", - "rememo": "^4.0.0" + "rememo": "^4.0.0", + "remove-accents": "^0.4.2" } }, "@wordpress/element": { diff --git a/packages/editor/package.json b/packages/editor/package.json index 286e1a4b2cd7f..37ca182c2bfa7 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -61,7 +61,8 @@ "lodash": "^4.17.21", "memize": "^1.1.0", "react-autosize-textarea": "^7.1.0", - "rememo": "^4.0.0" + "rememo": "^4.0.0", + "remove-accents": "^0.4.2" }, "peerDependencies": { "react": "^17.0.0", diff --git a/packages/editor/src/components/page-attributes/parent.js b/packages/editor/src/components/page-attributes/parent.js index c0bfaaf38f1df..f05f94508cd9a 100644 --- a/packages/editor/src/components/page-attributes/parent.js +++ b/packages/editor/src/components/page-attributes/parent.js @@ -1,13 +1,8 @@ /** * External dependencies */ -import { - get, - unescape as unescapeString, - debounce, - find, - deburr, -} from 'lodash'; +import { get, unescape as unescapeString, debounce, find } from 'lodash'; +import removeAccents from 'remove-accents'; /** * WordPress dependencies @@ -32,8 +27,8 @@ function getTitle( post ) { } export const getItemPriority = ( name, searchValue ) => { - const normalizedName = deburr( name ).toLowerCase(); - const normalizedSearch = deburr( searchValue ).toLowerCase(); + const normalizedName = removeAccents( name || '' ).toLowerCase(); + const normalizedSearch = removeAccents( searchValue || '' ).toLowerCase(); if ( normalizedName === normalizedSearch ) { return 0; }