-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(material/datepicker): display datepicker inside a dialog example #29404
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
Conversation
811a3f0
to
7ee8945
Compare
Maybe it would worth mentioning that the the |
c50c7cd
to
69156c9
Compare
<h2 mat-dialog-title>Calendar in a Dialog</h2> | ||
<mat-dialog-content align="center"> | ||
<div class="example-calendar-container"> | ||
<mat-calendar [(selected)]="data.selectedDate"></mat-calendar> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only showing a calendar inside the dialog, not a full datepicker. Should we rename the example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated it to use the datepicker instead.
@@ -0,0 +1,4 @@ | |||
.example-calendar-container { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you avoid these styles by passing the width/height into the dialog open
call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
69156c9
to
d608828
Compare
MatButtonModule, | ||
MatFormFieldModule, | ||
MatInputModule, | ||
FormsModule, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FormsModule, |
It's unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
</mat-form-field> | ||
</mat-dialog-content> | ||
<mat-dialog-actions> | ||
<button mat-button (click)="onClear()">Clear</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that this example is based on the "Dialog Overview", however using mat-dialog-close
should reduce the unrelated code even more.
<button mat-button (click)="onClear()">Clear</button> | |
<button mat-button mat-dialog-close>Clear</button> |
This would eliminate the need for the onClear
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I updated it.
d608828
to
369badb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but there's a lint warning that's failing the CI.
Adds an example that demonstrates how to display a datepicker inside a matDialog component. Fixes angular#28186
369badb
to
13daaea
Compare
…angular#29404) Adds an example that demonstrates how to display a datepicker inside a matDialog component.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Adds an example that demonstrates how to display a datepicker inside a matDialog component.
Fixes #28186