Skip to content

Commit

Permalink
tabs: fix focus bug on selected tab
Browse files Browse the repository at this point in the history
  • Loading branch information
chaance committed Nov 6, 2019
1 parent c011c1a commit 22f8e99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/tabs/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ export const Tab = forwardRef(function Tab(
const ref = useForkedRef(forwardedRef, ownRef);

useUpdateEffect(() => {
if (isSelected && ref.current && _userInteractedRef.current) {
if (isSelected && ownRef.current && _userInteractedRef.current) {
_userInteractedRef.current = false;
ref.current.focus();
ownRef.current.focus();
}
}, [isSelected]);

Expand Down

0 comments on commit 22f8e99

Please sign in to comment.