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

md-datepicker - should emit selectedChanged when changed by input #6000

Closed
wilker7ribeiro opened this issue Jul 24, 2017 · 6 comments · Fixed by #6025
Closed

md-datepicker - should emit selectedChanged when changed by input #6000

wilker7ribeiro opened this issue Jul 24, 2017 · 6 comments · Fixed by #6025
Assignees
Labels
needs: discussion Further discussion with the team is needed before proceeding

Comments

@wilker7ribeiro
Copy link

Bug, feature request, or proposal:

Bug

What is the expected behavior?

The name and documentation suggests that selectedChanged should emit even when the date selected is changed by input text

What is the current behavior?

It is emitted only by the calendar

Plunker template: http://plnkr.co/edit/2TqobMq2CJgm7LJtlK3j

@wilker7ribeiro wilker7ribeiro changed the title md-datepicker - selectedChanged should emit when changed by input md-datepicker - should emit selectedChanged when changed by input Jul 24, 2017
@devversion devversion self-assigned this Jul 24, 2017
@rafaelss95
Copy link
Contributor

For me, it's the expected behavior. To detect input changes you should use (change) or even (ngModelChange).

@devversion
Copy link
Member

I think this is also pretty reasonable.

Although I can also the confusion that people expect the selectedChanged output to fire because when changing the input it would also lead to an "actual" change of the selected date.

@willshowell
Copy link
Contributor

If it does remain as-is, the jsdoc comment should probably note that it emits when change comes from datepicker specifically.

Currently:

selectedChanged | Emits new selected date when selected date changes.

@devversion
Copy link
Member

@willshowell Yeah that would be for sure. If the behavior stays the same, the docs need to be more explicit about it.

@wilker7ribeiro
Copy link
Author

@rafaelss95 (ngModelChange) does trigger even with invalid date, and (change) only triggers on blur or enter key.
Actually, I'm using mdDatepickerInput._valueChange, but I'm having issues with validation time

devversion added a commit to devversion/material2 that referenced this issue Jul 25, 2017
* Deprecates the `selectedChanged` output on the datepicker component in favor of the `dateChange` and `dateInput` bindings on the input element.

Closes angular#6000
andrewseguin pushed a commit that referenced this issue Jul 27, 2017
* Deprecates the `selectedChanged` output on the datepicker component in favor of the `dateChange` and `dateInput` bindings on the input element.

Closes #6000
@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
@mmalerba mmalerba added the needs: discussion Further discussion with the team is needed before proceeding label Mar 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: discussion Further discussion with the team is needed before proceeding
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants