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

Remove auto-focusing appender onSelectOrClose #67851

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import clsx from 'clsx';
* WordPress dependencies
*/
import { Button } from '@wordpress/components';
import { forwardRef, useRef } from '@wordpress/element';
import { forwardRef } from '@wordpress/element';
import { _x, sprintf } from '@wordpress/i18n';
import { Icon, plus } from '@wordpress/icons';
import deprecated from '@wordpress/deprecated';
Expand All @@ -16,15 +16,11 @@ import deprecated from '@wordpress/deprecated';
* Internal dependencies
*/
import Inserter from '../inserter';
import { useMergeRefs } from '@wordpress/compose';

function ButtonBlockAppender(
{ rootClientId, className, onFocus, tabIndex, onSelect },
ref
) {
const inserterButtonRef = useRef();

const mergedInserterButtonRef = useMergeRefs( [ inserterButtonRef, ref ] );
return (
<Inserter
position="bottom center"
Expand All @@ -34,7 +30,6 @@ function ButtonBlockAppender(
if ( onSelect && typeof onSelect === 'function' ) {
onSelect( ...args );
}
inserterButtonRef.current?.focus();
} }
renderToggle={ ( {
onToggle,
Expand All @@ -61,7 +56,7 @@ function ButtonBlockAppender(
return (
<Button
__next40pxDefaultSize
ref={ mergedInserterButtonRef }
ref={ ref }
onFocus={ onFocus }
tabIndex={ tabIndex }
className={ clsx(
Expand Down
Loading