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

RichText: remove dead and deprecated setFocusedElement #29877

Merged
merged 2 commits into from
Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/rich-text/package.json
Expand Up @@ -29,7 +29,6 @@
"@babel/runtime": "^7.12.5",
"@wordpress/compose": "file:../compose",
"@wordpress/data": "file:../data",
"@wordpress/deprecated": "file:../deprecated",
"@wordpress/dom": "file:../dom",
"@wordpress/element": "file:../element",
"@wordpress/escape-html": "file:../escape-html",
Expand Down
16 changes: 0 additions & 16 deletions packages/rich-text/src/component/index.js
Expand Up @@ -18,7 +18,6 @@ import {
SPACE,
ESCAPE,
} from '@wordpress/keycodes';
import deprecated from '@wordpress/deprecated';
import { getFilesFromDataTransfer } from '@wordpress/dom';
import { useMergeRefs } from '@wordpress/compose';

Expand Down Expand Up @@ -147,8 +146,6 @@ function RichText(
onSelectionChange,
onChange,
unstableOnFocus: onFocus,
setFocusedElement,
instanceId,
clientId,
identifier,
__unstableMultilineTag: multilineTag,
Expand Down Expand Up @@ -963,12 +960,6 @@ function RichText(
* documented, as the current requirements where it is used are subject to
* future refactoring following `isSelected` handling.
*
* In contrast with `setFocusedElement`, this is only triggered in response
* to focus within the contenteditable field, whereas `setFocusedElement`
* is triggered on focus within any `RichText` descendent element.
*
* @see setFocusedElement
*
* @private
*/
function handleFocus() {
Expand Down Expand Up @@ -1010,13 +1001,6 @@ function RichText(
rafId.current = getWin().requestAnimationFrame( handleSelectionChange );

getDoc().addEventListener( 'selectionchange', handleSelectionChange );

if ( setFocusedElement ) {
deprecated( 'wp.blockEditor.RichText setFocusedElement prop', {
alternative: 'selection state from the block editor store.',
} );
setFocusedElement( instanceId );
}
}

function handleBlur() {
Expand Down