-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(slide-toggle): input not updated after drag (#3067)
The `MdSlideToggle` uses the OnPush ChangeDetection strategy for the component. **Problem Explanation** When the thumb is being dragged and the value changes, the new value is currently applied after a timeout. This timeout does not trigger any change detection, and the new value won't be applied to the underlying input. **Solution** With this change, the new value is applied immediately in the `dragend` event (because events trigger a change detection) and just the `dragging` state will be updated in the next tick. The timeout is required to ensure that there will be no `click` event after the `dragend` event.
- Loading branch information
1 parent
bc9d25b
commit 5cdeb75
Showing
2 changed files
with
67 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters