Skip to content

fix(material/tabs): validate animation duration#33452

Merged
crisbeto merged 1 commit into
angular:mainfrom
crisbeto:tabs-animation-duration-validation
Jun 27, 2026
Merged

fix(material/tabs): validate animation duration#33452
crisbeto merged 1 commit into
angular:mainfrom
crisbeto:tabs-animation-duration-validation

Conversation

@crisbeto

Copy link
Copy Markdown
Member

Adds some logic to validate the animation duration for the data before assigning it to the DOM. Along the same lines as 0df0042.

Adds some logic to validate the animation duration for the data before assigning it to the DOM. Along the same lines as 0df0042.
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Jun 26, 2026
@pullapprove pullapprove Bot requested review from ok7sai and tjshiu June 26, 2026 07:31
export function normalizeDuration(value: string | number): string {
const stringValue = value + '';

if (/^[0-9]+(?:\.[0-9]+)?$/.test(stringValue)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be /^[0-9]*? * instead of + because number like .5 is valid in CSS

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point, although we also didn't support it until now either. I'll keep it simple for now and we can revisit if anybody runs into it.

@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Jun 27, 2026
@crisbeto crisbeto merged commit 58a7807 into angular:main Jun 27, 2026
33 of 36 checks passed
@crisbeto

Copy link
Copy Markdown
Member Author

This PR was merged into the repository. The changes were merged into the following branches:

crisbeto added a commit that referenced this pull request Jun 27, 2026
Adds some logic to validate the animation duration for the data before assigning it to the DOM. Along the same lines as 0df0042.

(cherry picked from commit 58a7807)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: material/tabs target: patch This PR is targeted for the next patch release

2 participants