Skip to content
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

fix(material/slider): make valueChange emit only on change and not on… #26535

Merged
merged 1 commit into from
Feb 14, 2023

Conversation

wagnermaciel
Copy link
Contributor

@wagnermaciel wagnermaciel commented Feb 1, 2023

… input

Fixes #26496

@wagnermaciel wagnermaciel added the target: patch This PR is targeted for the next patch release label Feb 1, 2023
@mmalerba
Copy link
Contributor

mmalerba commented Feb 1, 2023

Is there a bug associated with this?

@wagnermaciel
Copy link
Contributor Author

Yes - #26496

@mmalerba mmalerba added the action: merge The PR is ready for merge by the caretaker label Feb 2, 2023
@devversion devversion removed their request for review February 3, 2023 14:02
@angelaki
Copy link

Since the new behavior is just different and not wrong, maybe it would be nice to switch the behavior (keeping the old one as default)? If interessnted, I'd adopt the PR regardingly.

@wagnermaciel
Copy link
Contributor Author

@angelaki Technically the new behavior is wrong. The valueChange event should only emit on value change which is different from on input

@angelaki
Copy link

@wagnermaciel Ah, I see! If I'm interessted in all the intermediate values I should listen to onInput? But where to find this event? It doesn't seam to be part of the documentation (https://material.angular.io/components/slider/api). Thank you for clarification.

@wagnermaciel
Copy link
Contributor Author

@angelaki Hey, yep you're right. With the latest implementation of the slider, the native browser inputs are exposed, which means you can just listen to input events directly on it as if it was an <input type="range" />.

I believe the syntax should be something like this:

<mat-slider>
    <input matSliderThumb (input)="handleInput($event)">
</mat-slider>

@angular-robot angular-robot bot merged commit 6d89b9d into angular:main Feb 14, 2023
angular-robot bot pushed a commit that referenced this pull request Feb 14, 2023
crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this pull request Feb 22, 2023
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@angular/cdk](https://github.com/angular/components) | dependencies | patch | [`15.1.4` -> `15.1.5`](https://renovatebot.com/diffs/npm/@angular%2fcdk/15.1.4/15.1.5) |
| [@angular/material](https://github.com/angular/components) | dependencies | patch | [`15.1.4` -> `15.1.5`](https://renovatebot.com/diffs/npm/@angular%2fmaterial/15.1.4/15.1.5) |

---

### Release Notes

<details>
<summary>angular/components</summary>

### [`v15.1.5`](https://github.com/angular/components/blob/HEAD/CHANGELOG.md#&#8203;1515-highdensityfoam-pelican-2023-02-16)

[Compare Source](angular/components@15.1.4...15.1.5)

##### material

| Commit | Type | Description |
| -- | -- | -- |
| [994e0a14c](angular/components@994e0a1) | fix | **core:** Fix legacy prebuilt themes export ([#&#8203;26624](angular/components#26624)) |
| [4c8cad2d2](angular/components@4c8cad2) | fix | **radio:** input not focused when clicking on touch target ([#&#8203;26618](angular/components#26618)) |
| [890765bf4](angular/components@890765b) | fix | **slider:** make valueChange emit only on change and not on input ([#&#8203;26535](angular/components#26535)) |

#### Special Thanks

Kai Schönberger, Kristiyan Kostadinov, Lukáš Matta, Wagner Maciel, Zach Arend and ᚷᛁᛟᚱᚷᛁ ᛒᚨᛚᚨᚲᚻᚨᛞᛉᛖ

<!-- CHANGELOG SPLIT MARKER -->

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNDEuMCIsInVwZGF0ZWRJblZlciI6IjM0LjE0MS4wIn0=-->

Co-authored-by: cabr2-bot <cabr2.help@gmail.com>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1788
Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org>
Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
@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 Mar 17, 2023
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 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(mat-slider): value updated on slide
3 participants