Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

fix(tabs): labels with fraction CSS width disabling pagination #5801

Closed

Conversation

alexandrebrasil
Copy link
Contributor

When the md-tab-label CSS width is calculated to a fraction numbem, its value and element.offsetWidth don't match. When the paging container's width is calculated, depending on how the offsetWidth of each label is truncated/rounded, the resulting width is smaller then the actual sum of
all labels. The smaller width causes a line break and forces the last label to go to next line with its offsetLeft to be zero, and that results in the next page button to be disabled. The new width calculation adds 1px to the offsetWidth to account for rounding/truncating errors, resulting in a slightly bigger paging container.

Fixes #5794, Fixes #5770, Fixes #5692.

When the md-tab-label CSS width is calculated to a fraction numbem, its
value and element.offsetWidth don't match. When the paging container's
width is calculated, depending on how the offsetWidth of each label is
truncated/rounded, the resulting width is smaller then the actual sum of
all labels, and that breaks the line and forces the last label to go to
next line, and its offsetLeft to be zero. That behaviour disables the next
page button, causing the pagination to not work. The new width calculation
adds 1px to the offsetWidth to account for rounding/truncating errors,
resulting in a slightly bigger paging container.

Fixes angular#5794.
@stewones
Copy link

+1 for this PR please!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants