-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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-experimental/mdc-slider): thumb incorrectly positioned when inside an overlay #25288
Conversation
…hen inside an overlay Fixes an issue where the thumb of an MDC slider wasn't positioned correctly when it has an initial value inside an overlay that is being animated. There are multiple ways to resolve this, but I ended up doing it by removing our logic that skips the first `ResizeObserver` emission since we can get around the performance issues with the `layout` call by reusing the dimensions provided in the callback. Fixes angular#25286.
this._resizeTimer = setTimeout(() => { | ||
// The `layout` call is going to call `getBoundingClientRect` to update the dimensions | ||
// of the host. Since the `ResizeObserver` already calculated them, we can save some | ||
// work by returning them instead of having to check the DOM again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional nit:
// work by returning them instead of having to check the DOM again. | |
// work by caching them instead of having to check the DOM again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The caching isn't permanent though. It gets reset after the layout
call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I just wasn't sure where you "returned" it, but the comment makes sense regardless.
…hen inside an overlay (#25288) Fixes an issue where the thumb of an MDC slider wasn't positioned correctly when it has an initial value inside an overlay that is being animated. There are multiple ways to resolve this, but I ended up doing it by removing our logic that skips the first `ResizeObserver` emission since we can get around the performance issues with the `layout` call by reusing the dimensions provided in the callback. Fixes #25286. (cherry picked from commit fb4d7a0)
…hen inside an overlay (#25288) Fixes an issue where the thumb of an MDC slider wasn't positioned correctly when it has an initial value inside an overlay that is being animated. There are multiple ways to resolve this, but I ended up doing it by removing our logic that skips the first `ResizeObserver` emission since we can get around the performance issues with the `layout` call by reusing the dimensions provided in the callback. Fixes #25286. (cherry picked from commit fb4d7a0)
…s dragging Fixes an internal bug caused by angular#25288 where a slider was resizing while the user is dragging, causing the thumb to jump around.
…s dragging Fixes an internal bug caused by angular#25288 where a slider was resizing while the user is dragging, causing the thumb to jump around.
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@angular/cdk](https://github.com/angular/components) | dependencies | patch | [`14.0.5` -> `14.0.6`](https://renovatebot.com/diffs/npm/@angular%2fcdk/14.0.5/14.0.6) | | [@angular/material](https://github.com/angular/components) | dependencies | patch | [`14.0.5` -> `14.0.6`](https://renovatebot.com/diffs/npm/@angular%2fmaterial/14.0.5/14.0.6) | --- ### Release Notes <details> <summary>angular/components</summary> ### [`v14.0.6`](https://github.com/angular/components/blob/HEAD/CHANGELOG.md#​1406-chromium-pinball-2022-07-20) [Compare Source](angular/components@14.0.5...14.0.6) ##### material | Commit | Type | Description | | -- | -- | -- | | [cc510216a](angular/components@cc51021) | fix | **autocomplete:** prevent outside clicks from going to other overlays ([#​25243](angular/components#25243)) | | [b73b2fb85](angular/components@b73b2fb) | fix | **checkbox:** incorrect animation state when going from pre-checked to indeterminate ([#​25297](angular/components#25297)) | | [e7b359286](angular/components@e7b3592) | fix | **slider:** add cancelable checks to touchmove and touchend events ([#​25301](angular/components#25301)) | | [d7e422668](angular/components@d7e4226) | fix | **tabs:** disable tab label color transition when animations are disabled ([#​25308](angular/components#25308)) | ##### material-experimental | Commit | Type | Description | | -- | -- | -- | | [43bfbac51](angular/components@43bfbac) | fix | **mdc-slider:** thumb incorrectly positioned when inside an overlay ([#​25288](angular/components#25288)) | #### Special Thanks Alka Vats, John Vandenberg, Kristiyan Kostadinov and Oliver Kierepka <!-- 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, click this checkbox. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMTkuMiIsInVwZGF0ZWRJblZlciI6IjMyLjExOS4yIn0=--> Co-authored-by: cabr2-bot <[email protected]> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1469 Reviewed-by: Epsilon_02 <[email protected]> Co-authored-by: Calciumdibromid Bot <[email protected]> Co-committed-by: Calciumdibromid Bot <[email protected]>
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Fixes an issue where the thumb of an MDC slider wasn't positioned correctly when it has an initial value inside an overlay that is being animated.
There are multiple ways to resolve this, but I ended up doing it by removing our logic that skips the first
ResizeObserver
emission since we can get around the performance issues with thelayout
call by reusing the dimensions provided in the callback.Fixes #25286.