Skip to content

Conversation

crisbeto
Copy link
Member

Fixes a bug reported internally where the tabs pagination was going into an infinite loop at some widths.

The root cause is a bit unclear, but it looks like in some cases Safari rounds up the scrollWidth and in some it doesn't which we end up hitting when adding/removing the pagination.

These changes work around it by adding a 5px threshold that needs to be crossed before we start showing the pagination. The threshold shouldn't be noticable for users since the tabs have a 24px padding on each side.

Fixes a bug reported internally where the tabs pagination was going into an infinite loop at some widths.

The root cause is a bit unclear, but it looks like in some cases Safari rounds up the `scrollWidth` and in some it doesn't which we end up hitting when adding/removing the pagination.

These changes work around it by adding a 5px threshold that needs to be crossed before we start showing the pagination. The threshold shouldn't be noticable for users since the tabs have a 24px padding on each side.
@crisbeto crisbeto added G This is is related to a Google internal issue target: patch This PR is targeted for the next patch release labels May 26, 2024
@crisbeto crisbeto self-assigned this May 28, 2024
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label May 28, 2024
@crisbeto crisbeto merged commit cc00a74 into angular:main May 28, 2024
crisbeto added a commit that referenced this pull request May 28, 2024
Fixes a bug reported internally where the tabs pagination was going into an infinite loop at some widths.

The root cause is a bit unclear, but it looks like in some cases Safari rounds up the `scrollWidth` and in some it doesn't which we end up hitting when adding/removing the pagination.

These changes work around it by adding a 5px threshold that needs to be crossed before we start showing the pagination. The threshold shouldn't be noticable for users since the tabs have a 24px padding on each side.

(cherry picked from commit cc00a74)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker G This is is related to a Google internal issue target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants