Skip to content

Commit

Permalink
Fix pointerdown
Browse files Browse the repository at this point in the history
  • Loading branch information
mj12albert committed Feb 18, 2025
1 parent 956563b commit 9ddf851
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/react/src/tabs/tab/useTabsTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,14 @@ function useTabsTab(parameters: useTabsTab.Parameters): useTabsTab.ReturnValue {
setHighlightedTabIndex(index);
}

if (!activateOnFocus || disabled) {
if (disabled) {
return;
}

if (!isPressingRef.current || (isPressingRef.current && isMainButtonRef.current)) {
if (
(activateOnFocus && !isPressingRef.current) || // keyboard focus
(isPressingRef.current && isMainButtonRef.current) // focus caused by pointerdown
) {
onTabActivation(tabValue, event.nativeEvent);
}
},
Expand Down

0 comments on commit 9ddf851

Please sign in to comment.