Skip to content

fix: Suppress tab-header resize oscillation that causes infinite update loop#4675

Draft
NathanZlion wants to merge 1 commit into
mainfrom
fix/awsui-62011-tabs-overflow-oscillation
Draft

fix: Suppress tab-header resize oscillation that causes infinite update loop#4675
NathanZlion wants to merge 1 commit into
mainfrom
fix/awsui-62011-tabs-overflow-oscillation

Conversation

@NathanZlion

@NathanZlion NathanZlion commented Jun 29, 2026

Copy link
Copy Markdown
Member

When the tabs container is near the overflow threshold, showing/hiding pagination buttons causes a layout shift (~73px) that immediately flips the overflow state back, creating an infinite ResizeObserver loop that eventually triggers React's 'Maximum update depth exceeded' error.

Fix: apply a 2px threshold to the useContainerQuery callback so that sub-pixel or pagination-button-sized width changes are not propagated as new measurements, breaking the oscillation cycle.

Mirrors the pattern used in useContainerWidth (PR #4615).

Fixes AWSUI-62011

Description

Related links, issue #, if available: n/a

How has this been tested?

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…te loop

When the tabs container is near the overflow threshold, showing/hiding
pagination buttons causes a layout shift (~73px) that immediately flips
the overflow state back, creating an infinite ResizeObserver loop that
eventually triggers React's 'Maximum update depth exceeded' error.

Fix: apply a 2px threshold to the useContainerQuery callback so that
sub-pixel or pagination-button-sized width changes are not propagated
as new measurements, breaking the oscillation cycle.

Mirrors the pattern used in useContainerWidth (PR #4615).

Fixes AWSUI-62011
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.56%. Comparing base (f968598) to head (4a6d4c3).
⚠️ Report is 32 commits behind head on main.

Files with missing lines Patch % Lines
src/tabs/tab-header-bar.tsx 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4675      +/-   ##
==========================================
+ Coverage   97.51%   97.56%   +0.05%     
==========================================
  Files         948      948              
  Lines       30346    30492     +146     
  Branches    11067    11151      +84     
==========================================
+ Hits        29593    29751     +158     
+ Misses        706      694      -12     
  Partials       47       47              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant