Skip to content

Commit

Permalink
CustomSelectControl: Fix menuProps mutation (#62149)
Browse files Browse the repository at this point in the history
Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
  • Loading branch information
3 people authored May 31, 2024
1 parent eb2b8a5 commit b76de86
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/components/src/custom-select-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default function CustomSelectControl( props ) {
return sprintf( __( 'Currently selected: %s' ), selectedItem.name );
}

const menuProps = getMenuProps( {
let menuProps = getMenuProps( {
className: 'components-custom-select-control__menu',
'aria-hidden': ! isOpen,
} );
Expand All @@ -131,7 +131,11 @@ export default function CustomSelectControl( props ) {
if (
menuProps[ 'aria-activedescendant' ]?.startsWith( 'downshift-null' )
) {
delete menuProps[ 'aria-activedescendant' ];
const {
'aria-activedescendant': ariaActivedescendant,
...restMenuProps
} = menuProps;
menuProps = restMenuProps;
}
return (
<div
Expand Down

0 comments on commit b76de86

Please sign in to comment.