Skip to content

Commit

Permalink
dont apply when selectOnMove is false
Browse files Browse the repository at this point in the history
  • Loading branch information
chad1008 committed Dec 1, 2023
1 parent d3cb57b commit 19c8cd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/components/src/tabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function Tabs( {
// In controlled mode, make sure browser focus follows the selected tab if
// the selection is changed while a tab is already being focused.
useLayoutEffect( () => {
if ( ! isControlled ) {
if ( ! isControlled || ! selectOnMove ) {
return;
}

Expand All @@ -174,7 +174,7 @@ function Tabs( {
) {
move( selectedId );
}
}, [ isControlled, move, selectedId, tabsHasFocus ] );
}, [ isControlled, move, selectOnMove, selectedId, tabsHasFocus ] );

const contextValue = useMemo(
() => ( {
Expand Down

0 comments on commit 19c8cd4

Please sign in to comment.