Skip to content

Commit 1bec9dc

Browse files
authored
docs: prevent form submission in examples (#19240)
There were a couple of examples which would trigger a page refresh if the user pressed one of the buttons, because we were using a form without preventing its default action.
1 parent d4d12a9 commit 1bec9dc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components-examples/cdk/text-field/text-field-autofill-directive/text-field-autofill-directive-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<form>
1+
<form (submit)="$event.preventDefault()">
22
<mat-form-field>
33
<mat-label>First name</mat-label>
44
<input matInput (cdkAutofill)="firstNameAutofilled = $event.isAutofilled">

src/components-examples/cdk/text-field/text-field-autofill-monitor/text-field-autofill-monitor-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<form>
1+
<form (submit)="$event.preventDefault()">
22
<mat-form-field>
33
<mat-label>First name</mat-label>
44
<input matInput #first>

0 commit comments

Comments
 (0)