Skip to content

Commit

Permalink
Tabs: recalculate stripe position when value changes (#2402)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank99 authored Jan 14, 2025
1 parent 74b647f commit c48397e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/many-eggs-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@itwin/itwinui-react': patch
---

Fixed an issue in `Tabs` where it wasn't recalculating the active stripe position when a new tab was asynchronously added to the tablist.
1 change: 1 addition & 0 deletions packages/itwinui-react/src/core/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ const Tab = React.forwardRef((props, forwardedRef) => {
tabsWidth, // to fix visual artifact on initial render
setStripeProperties,
tablistRef,
value, // since Tab with a different value might be later added to the same position
]);

const onKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => {
Expand Down

0 comments on commit c48397e

Please sign in to comment.