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

bug(mat-mdc-slider): Thumb doesn't position properly when inside cdk-overlay (but track does) #25286

Closed
1 task
tomasdev opened this issue Jul 14, 2022 · 1 comment · Fixed by #25288
Closed
1 task
Assignees
Labels
area: material/slider G This is is related to a Google internal issue P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@tomasdev
Copy link

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

https://stackblitz.com/edit/angular-us2jqe-p5u8cl?file=src%2Fapp%2Fslider-overview-example.html,src%2Fapp%2Fslider-overview-example.ts

The thumb is not correctly positioned when the mat-slider is inside a menu. However, the track is.

Reproduction

Steps to reproduce:

  1. Have a mat-mdc-slider inside a mat-menu
  2. Open the menu

Expected Behavior

Both the track position / width and the thumb position are properly calculated.

Actual Behavior

Observe how the track position / width is properly calculated but the thumb is stuck at the left edge.

Environment

  • Angular: 13
  • CDK/Material: 13
  • Browser(s): All
  • Operating System (e.g. Windows, macOS, Ubuntu): All
@tomasdev tomasdev added the needs triage This issue needs to be triaged by the team label Jul 14, 2022
@crisbeto crisbeto self-assigned this Jul 15, 2022
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent has pr G This is is related to a Google internal issue area: material/slider and removed needs triage This issue needs to be triaged by the team labels Jul 15, 2022
crisbeto added a commit to crisbeto/material2 that referenced this issue Jul 15, 2022
…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.
crisbeto added a commit that referenced this issue Jul 15, 2022
…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)
crisbeto added a commit that referenced this issue Jul 15, 2022
…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.
crisbeto added a commit that referenced this issue Jul 15, 2022
…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)
@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 Aug 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/slider G This is is related to a Google internal issue P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
2 participants