Skip to content

Commit

Permalink
Improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed Dec 13, 2023
1 parent 9de4de7 commit 0e842b8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/components/src/form-token-field/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,12 @@ export function FormTokenField( props: FormTokenFieldProps ) {
if ( __experimentalExpandOnFocus ) {
// If `__experimentalExpandOnFocus` is true, don't close the suggestions list when
// the user clicks on it (`tokensAndInput` will be the element that caused the blur).
setIsExpanded( event.relatedTarget === tokensAndInput.current );
const hasFocusWithin =
event.relatedTarget === tokensAndInput.current;
setIsExpanded( hasFocusWithin );
} else {
// Else collapse the suggestion list. This will result in the suggestion list closing
// after a suggestion has been submitted since that causes a blur.
setIsExpanded( false );
}

Expand Down

0 comments on commit 0e842b8

Please sign in to comment.