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(MatSlider): the slider remains focused when dragging out of the window and back again. #18888

Closed
studioTeaTwo opened this issue Mar 23, 2020 · 1 comment · Fixed by #18905, lingounet/testage#29 or michael-vasyliv/ngx-virtual-swiper#24
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@studioTeaTwo
Copy link

Reproduction

Use StackBlitz to reproduce your issue: https://material.angular.io/components/slider/overview

Steps to reproduce:

  1. select version v9~
  2. click the slider of the demo
  3. drag out of the window
  4. move back in the window(either release the drag or not)
  5. the slider moves with the mouse (even though you did not click the slider)

Seeing mat-slider element in the inspecter at 4, the classes remains such as cdk-focused cdk-mouse-focused mat-slider-sliding.

Expected Behavior

When moving back in the window, focus is released and the slider doesn't move with the mouse.
As if you chose v8 or earlier and did the same in https://material.angular.io/components/slider/overview.

Actual Behavior

focus isn't released and the slider moves with the mouse.

Environment

  • Angular: v9~
  • CDK/Material: v9~
  • Browser(s): chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS
@studioTeaTwo studioTeaTwo added the needs triage This issue needs to be triaged by the team label Mar 23, 2020
@studioTeaTwo studioTeaTwo changed the title bug(MatSlider): the slider remains focused when dragging out of the window and back again, bug(MatSlider): the slider remains focused when dragging out of the window and back again. Mar 23, 2020
@crisbeto crisbeto self-assigned this Mar 24, 2020
@crisbeto crisbeto added has pr P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed needs triage This issue needs to be triaged by the team labels Mar 24, 2020
crisbeto added a commit to crisbeto/material2 that referenced this issue Mar 24, 2020
We're binding the slider events to the `document.body` which means that we won't pick up the ones that happen outside the viewport. These changes move the events to the `document`.

Fixes angular#18888.
jelbourn pushed a commit that referenced this issue Mar 31, 2020
)

We're binding the slider events to the `document.body` which means that we won't pick up the ones that happen outside the viewport. These changes move the events to the `document`.

Fixes #18888.
jelbourn pushed a commit that referenced this issue Apr 6, 2020
)

We're binding the slider events to the `document.body` which means that we won't pick up the ones that happen outside the viewport. These changes move the events to the `document`.

Fixes #18888.

(cherry picked from commit 1718d78)
@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 May 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
2 participants