Skip to content

Conversation

@devversion
Copy link
Member

While initially looking into #4124, there were a few more issues inside
of the slide-toggle.

  • ngModelChange event is dispatched at initialization.
  • Checked state isn't synchronized when state changes through drag. New state after dragging got overwritten by click event on label.
  • Removes unnecessary logic inside of change listener. Change event doesn't fire if underlying checkbox is disabled.
  • Slide-toggle turns touched only on blur. Similar as for native checkbox elements.

Note: Basically made the slide-toggle even more aligned with the native checkbox elements.

Fixes #4124.

@devversion devversion requested a review from jelbourn April 18, 2017 16:12
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Apr 18, 2017
@jelbourn jelbourn requested a review from tinayuangao April 18, 2017 17:02
@jelbourn jelbourn assigned tinayuangao and unassigned jelbourn Apr 18, 2017
@devversion devversion force-pushed the fix/slide-toggle-drag branch 2 times, most recently from d07ad6f to 9af7a1f Compare April 18, 2017 19:07
Copy link
Contributor

@tinayuangao tinayuangao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@devversion devversion added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Apr 19, 2017
@kara kara added pr: needs rebase and removed action: merge The PR is ready for merge by the caretaker labels Apr 21, 2017
@kara kara assigned devversion and unassigned tinayuangao Apr 21, 2017
@kara
Copy link
Contributor

kara commented Apr 21, 2017

@devversion Can you rebase?

While initially looking into angular#4124, there were a few more issues inside
of the slide-toggle.

* ngModelChange event is dispatched at initialization.

* Checked state isn't synchronized when state changes through drag. New state after dragging got overwritten by click event on label.

* Removes unnecessary logic inside of `change` listener. Change event doesn't fire if underlying checkbox is disabled.

Fixes angular#4124.
@devversion devversion force-pushed the fix/slide-toggle-drag branch from 9af7a1f to 11a28f7 Compare April 21, 2017 21:58
@devversion
Copy link
Member Author

@kara Done :)

@devversion devversion added action: merge The PR is ready for merge by the caretaker and removed pr: needs rebase labels Apr 21, 2017
@kara kara merged commit 317952a into angular:master Apr 21, 2017
kara added a commit to kara/material2 that referenced this pull request Apr 22, 2017
kara added a commit that referenced this pull request Apr 22, 2017
devversion added a commit to devversion/material2 that referenced this pull request Apr 22, 2017
…r#4218)

While initially looking into angular#4124, there were a few more issues inside of the slide-toggle.

* ngModelChange event is dispatched at initialization.

* Checked state isn't synchronized when state changes through drag. New state after dragging got overwritten by click event on label.

* Removes unnecessary logic inside of `change` listener. Change event doesn't fire if underlying checkbox is disabled.

Fixes angular#4124.
devversion added a commit to devversion/material2 that referenced this pull request Apr 30, 2017
…r#4218)

While initially looking into angular#4124, there were a few more issues inside of the slide-toggle.

* ngModelChange event is dispatched at initialization.

* Checked state isn't synchronized when state changes through drag. New state after dragging got overwritten by click event on label.

* Removes unnecessary logic inside of `change` listener. Change event doesn't fire if underlying checkbox is disabled.

Fixes angular#4124.
devversion added a commit to devversion/material2 that referenced this pull request Jun 12, 2017
…r#4218)

While initially looking into angular#4124, there were a few more issues inside of the slide-toggle.

* ngModelChange event is dispatched at initialization.

* Checked state isn't synchronized when state changes through drag. New state after dragging got overwritten by click event on label.

* Removes unnecessary logic inside of `change` listener. Change event doesn't fire if underlying checkbox is disabled.

Fixes angular#4124.
devversion added a commit to devversion/material2 that referenced this pull request Jun 14, 2017
…r#4218)

While initially looking into angular#4124, there were a few more issues inside of the slide-toggle.

* ngModelChange event is dispatched at initialization.

* Checked state isn't synchronized when state changes through drag. New state after dragging got overwritten by click event on label.

* Removes unnecessary logic inside of `change` listener. Change event doesn't fire if underlying checkbox is disabled.

Fixes angular#4124.
devversion added a commit to devversion/material2 that referenced this pull request Jun 14, 2017
…r#4218)

While initially looking into angular#4124, there were a few more issues inside of the slide-toggle.

* ngModelChange event is dispatched at initialization.

* Checked state isn't synchronized when state changes through drag. New state after dragging got overwritten by click event on label.

* Removes unnecessary logic inside of `change` listener. Change event doesn't fire if underlying checkbox is disabled.

Fixes angular#4124.
devversion added a commit to devversion/material2 that referenced this pull request Jun 22, 2017
…r#4218)

While initially looking into angular#4124, there were a few more issues inside of the slide-toggle.

* ngModelChange event is dispatched at initialization.

* Checked state isn't synchronized when state changes through drag. New state after dragging got overwritten by click event on label.

* Removes unnecessary logic inside of `change` listener. Change event doesn't fire if underlying checkbox is disabled.

Fixes angular#4124.
mmalerba pushed a commit that referenced this pull request Jul 6, 2017
While initially looking into #4124, there were a few more issues inside of the slide-toggle.

* ngModelChange event is dispatched at initialization.

* Checked state isn't synchronized when state changes through drag. New state after dragging got overwritten by click event on label.

* Removes unnecessary logic inside of `change` listener. Change event doesn't fire if underlying checkbox is disabled.

Fixes #4124.
mmalerba pushed a commit that referenced this pull request Jul 6, 2017
While initially looking into #4124, there were a few more issues inside of the slide-toggle.

* ngModelChange event is dispatched at initialization.

* Checked state isn't synchronized when state changes through drag. New state after dragging got overwritten by click event on label.

* Removes unnecessary logic inside of `change` listener. Change event doesn't fire if underlying checkbox is disabled.

Fixes #4124.
mmalerba pushed a commit that referenced this pull request Jul 6, 2017
While initially looking into #4124, there were a few more issues inside of the slide-toggle.

* ngModelChange event is dispatched at initialization.

* Checked state isn't synchronized when state changes through drag. New state after dragging got overwritten by click event on label.

* Removes unnecessary logic inside of `change` listener. Change event doesn't fire if underlying checkbox is disabled.

Fixes #4124.
mmalerba pushed a commit that referenced this pull request Jul 6, 2017
While initially looking into #4124, there were a few more issues inside of the slide-toggle.

* ngModelChange event is dispatched at initialization.

* Checked state isn't synchronized when state changes through drag. New state after dragging got overwritten by click event on label.

* Removes unnecessary logic inside of `change` listener. Change event doesn't fire if underlying checkbox is disabled.

Fixes #4124.
devversion added a commit to devversion/material2 that referenced this pull request Jul 16, 2017
…r#4218)

While initially looking into angular#4124, there were a few more issues inside of the slide-toggle.

* ngModelChange event is dispatched at initialization.

* Checked state isn't synchronized when state changes through drag. New state after dragging got overwritten by click event on label.

* Removes unnecessary logic inside of `change` listener. Change event doesn't fire if underlying checkbox is disabled.

Fixes angular#4124.
devversion added a commit to devversion/material2 that referenced this pull request Jul 23, 2017
…r#4218)

While initially looking into angular#4124, there were a few more issues inside of the slide-toggle.

* ngModelChange event is dispatched at initialization.

* Checked state isn't synchronized when state changes through drag. New state after dragging got overwritten by click event on label.

* Removes unnecessary logic inside of `change` listener. Change event doesn't fire if underlying checkbox is disabled.

Fixes angular#4124.
andrewseguin pushed a commit that referenced this pull request Jul 27, 2017
While initially looking into #4124, there were a few more issues inside of the slide-toggle.

* ngModelChange event is dispatched at initialization.

* Checked state isn't synchronized when state changes through drag. New state after dragging got overwritten by click event on label.

* Removes unnecessary logic inside of `change` listener. Change event doesn't fire if underlying checkbox is disabled.

Fixes #4124.
andrewseguin pushed a commit that referenced this pull request Jul 27, 2017
While initially looking into #4124, there were a few more issues inside of the slide-toggle.

* ngModelChange event is dispatched at initialization.

* Checked state isn't synchronized when state changes through drag. New state after dragging got overwritten by click event on label.

* Removes unnecessary logic inside of `change` listener. Change event doesn't fire if underlying checkbox is disabled.

Fixes #4124.
andrewseguin pushed a commit that referenced this pull request Jul 28, 2017
* fix(slide-toggle): invalid model change event (#4140)" (#4218)

While initially looking into #4124, there were a few more issues inside of the slide-toggle.

* ngModelChange event is dispatched at initialization.

* Checked state isn't synchronized when state changes through drag. New state after dragging got overwritten by click event on label.

* Removes unnecessary logic inside of `change` listener. Change event doesn't fire if underlying checkbox is disabled.

Fixes #4124.

* Cast NgModel value to a boolean

* Properly mark component for check
@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 Sep 6, 2019
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 cla: yes PR author has agreed to Google's Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

slide-toggle fires undesired event when setting a default value

5 participants