Skip to content

fix(material/slider): handle null values in slider input #30621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

mistrykaran91
Copy link
Contributor

@mistrykaran91 mistrykaran91 commented Mar 12, 2025

The slider values behaved inconsistently when we reset the formGroup. This MR will resolve that issue by setting value to default value when its null

Fixes #30614

@mistrykaran91 mistrykaran91 requested a review from a team as a code owner March 12, 2025 10:58
@mistrykaran91 mistrykaran91 requested review from crisbeto and wagnermaciel and removed request for a team March 12, 2025 10:58
@mistrykaran91 mistrykaran91 force-pushed the bugfix/inconsistent-reset-behavior-for-mat-slider branch 2 times, most recently from 25d2edf to 77aabff Compare March 12, 2025 11:54
@mistrykaran91 mistrykaran91 marked this pull request as draft March 12, 2025 12:08
Copy link

@kenyerman kenyerman left a comment

Choose a reason for hiding this comment

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

thank you for working on this! ❤️
i've found some falsyness checks that can be improved, please review them and correct me if i'm wrong.

@mistrykaran91 mistrykaran91 force-pushed the bugfix/inconsistent-reset-behavior-for-mat-slider branch 3 times, most recently from 4cc752d to 4c1afd6 Compare March 12, 2025 12:54
@wagnermaciel wagnermaciel self-assigned this Mar 12, 2025
@mistrykaran91 mistrykaran91 force-pushed the bugfix/inconsistent-reset-behavior-for-mat-slider branch 2 times, most recently from 166eaee to 87cbe59 Compare March 13, 2025 05:04
The slider values behaved inconsistently when we reset the formGroup. This MR will resolve that issue by setting `value` to default value when its `null`

Fixes angular#30614
@mistrykaran91 mistrykaran91 force-pushed the bugfix/inconsistent-reset-behavior-for-mat-slider branch from 87cbe59 to 0a16cf5 Compare March 13, 2025 05:11
@mistrykaran91 mistrykaran91 changed the title fix(material/slider): handle null and undefined values in slider input fix(material/slider): handle null values in slider input Mar 13, 2025
@mistrykaran91 mistrykaran91 marked this pull request as ready for review March 13, 2025 05:11
@mistrykaran91 mistrykaran91 requested a review from kenyerman March 13, 2025 05:12
Copy link

@kenyerman kenyerman left a comment

Choose a reason for hiding this comment

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

looks good to me! 🚀

@wagnermaciel wagnermaciel removed the request for review from crisbeto March 17, 2025 14:36
@wagnermaciel wagnermaciel added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Mar 17, 2025
@wagnermaciel wagnermaciel merged commit 0e985f2 into angular:main Mar 17, 2025
23 of 25 checks passed
@mistrykaran91 mistrykaran91 deleted the bugfix/inconsistent-reset-behavior-for-mat-slider branch March 17, 2025 16:05
mistrykaran91 added a commit to mistrykaran91/components that referenced this pull request Apr 11, 2025
…sses if mat-label is added and removed dynamically

Currently, when `mat-Label` is added dynamically initially its not visible in DOM, this fix will added/remove classes  for the same.

Fixes angular#30621
@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 Apr 17, 2025
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 area: material/slider target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(MatSlider): Inconsistent Reset Behavior for mat-slider with Range Thumbs in Reactive Forms
3 participants