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

feat(datepicker): add mdDatepickerToggle & compatibility w/ md-input-container #3468

Merged
merged 3 commits into from
Mar 9, 2017

Conversation

mmalerba
Copy link
Contributor

@mmalerba mmalerba commented Mar 6, 2017

No description provided.

@mmalerba mmalerba requested review from jelbourn and kara March 6, 2017 22:20
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Mar 6, 2017
@kara kara changed the title feat(datepicker): add md-datepicker-trigger & compatability w/ md-input-container feat(datepicker): add md-datepicker-trigger & compatibility w/ md-input-container Mar 6, 2017
if (this._mdInputContainer) {
return this._mdInputContainer.getPopupConnectionElementRef();
} else {
return this._elementRef;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: ternary would be more readable?

<p>
<md-input-container>
<input mdInput [mdDatepicker]="dp2" [(ngModel)]="date">
<md-datepicker-trigger mdSuffix [for]="dp2"></md-datepicker-trigger>
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm guessing you've already thought this through, but any way to avoid requiring this element? If at all possible, it feels like this should be built in somewhere. Can we have the [mdDatepicker] directive add the class and the open method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This allows for more flexibility, the icon trigger can be in the prefix, suffix, or completely outside of the input-container.

Copy link
Contributor

@kara kara Mar 9, 2017

Choose a reason for hiding this comment

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

Gotcha; that makes sense. If it's going to be separate, how about making the datepicker-trigger a button? I think part of the weirdness for me is that the input should itself be a trigger, so adding something else called "trigger" threw me off. Also better to have a native button for a11y.

Jeremy and I were thinking maybe:

<input [mdDatepicker]="dp">
<button mdDatepickerToggle></button>
<md-datepicker #dp></md-datepicker>

@@ -379,4 +381,8 @@ export class MdInputContainer implements AfterContentInit {

this._mdInputChild.ariaDescribedby = ids.join(' ');
}

getPopupConnectionElementRef(): ElementRef {
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels like this should be named for the underline, given that there may be other non-popup components that might want to hook in here.

@mmalerba
Copy link
Contributor Author

mmalerba commented Mar 8, 2017

comments addressed

@mmalerba
Copy link
Contributor Author

mmalerba commented Mar 9, 2017

renamed trigger, PTAL

Copy link
Contributor

@kara kara left a comment

Choose a reason for hiding this comment

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

LGTM

@kara kara added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Mar 9, 2017
@kara kara unassigned jelbourn and kara Mar 9, 2017
@mmalerba mmalerba changed the title feat(datepicker): add md-datepicker-trigger & compatibility w/ md-input-container feat(datepicker): add mdDatepickerToggle & compatibility w/ md-input-container Mar 9, 2017
@mmalerba mmalerba merged commit a489c03 into angular:datepicker Mar 9, 2017
mmalerba added a commit that referenced this pull request Mar 17, 2017
…ut-container (#3468)

feat(datepicker): add mdDatepickerToggle & compatibility w/ md-input-container
mmalerba added a commit to mmalerba/components that referenced this pull request Mar 28, 2017
…ut-container (angular#3468)

feat(datepicker): add mdDatepickerToggle & compatibility w/ md-input-container
mmalerba added a commit that referenced this pull request Apr 14, 2017
…ut-container (#3468)

feat(datepicker): add mdDatepickerToggle & compatibility w/ md-input-container
mmalerba added a commit that referenced this pull request Apr 20, 2017
…ut-container (#3468)

feat(datepicker): add mdDatepickerToggle & compatibility w/ md-input-container
mmalerba added a commit that referenced this pull request Apr 29, 2017
…ut-container (#3468)

feat(datepicker): add mdDatepickerToggle & compatibility w/ md-input-container
mmalerba added a commit that referenced this pull request May 5, 2017
…ut-container (#3468)

feat(datepicker): add mdDatepickerToggle & compatibility w/ md-input-container
mmalerba added a commit that referenced this pull request May 9, 2017
…ut-container (#3468)

feat(datepicker): add mdDatepickerToggle & compatibility w/ md-input-container
@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.

4 participants