Skip to content

docs(material/datepicker): fix up dialog example #31674

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<h2 mat-dialog-title>Datepicker in a Dialog</h2>
<mat-dialog-content align="center">
<mat-form-field>
<mat-dialog-content>
<mat-form-field subscriptSizing="dynamic">
<mat-label>Select a date</mat-label>
<input matInput [matDatepicker]="picker" [formControl]="date">
<mat-datepicker-toggle matIconSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field>
</mat-dialog-content>
<mat-dialog-actions>
<button matButton mat-dialog-close>Clear</button>
<button matButton [mat-dialog-close]="date.value" cdkFocusInitial>Ok</button>
<mat-dialog-actions align="end">
<button matButton mat-dialog-close>CANCEL</button>
<button matButton [mat-dialog-close]="date.value" cdkFocusInitial>OK</button>
</mat-dialog-actions>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<p>Selected date: {{selectedDate()}}</p>
<button matButton="filled" color="primary" (click)="openDialog()">Open Dialog</button>
<button matButton="filled" color="primary" (click)="openDialog()">Open Dialog</button>
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class DatepickerDialogExample {

openDialog() {
const dialogRef = this.dialog.open(DatepickerDialogExampleDialog, {
minWidth: '500px',
data: {selectedDate: this.selectedDate()},
});

Expand Down
Loading