Skip to content

Commit

Permalink
scrollIntoView instead of focus
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Aug 31, 2022
1 parent 7ef492d commit b62f4f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/components/src/popover/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ export const Default = ( args ) => {
};
const buttonRef = useRef();
useEffect( () => {
buttonRef.current?.focus();
buttonRef.current?.scrollIntoView?.( {
block: 'center',
inline: 'center',
} );
}, [] );

return (
Expand Down

0 comments on commit b62f4f8

Please sign in to comment.