From 9a06ac117bfd8c0169d200c94bb049e09c69b9e4 Mon Sep 17 00:00:00 2001 From: Terry Gong Date: Mon, 4 Nov 2024 16:52:20 +1030 Subject: [PATCH 1/2] Add new attribute initialvalue to the form-field --- .../components/form-field/form-field.component.html | 1 + packages/ui/src/types/authenticator/form.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/packages/angular/projects/ui-angular/src/lib/components/authenticator/components/form-field/form-field.component.html b/packages/angular/projects/ui-angular/src/lib/components/authenticator/components/form-field/form-field.component.html index 528b2084a59..c36a06028ba 100644 --- a/packages/angular/projects/ui-angular/src/lib/components/authenticator/components/form-field/form-field.component.html +++ b/packages/angular/projects/ui-angular/src/lib/components/authenticator/components/form-field/form-field.component.html @@ -33,6 +33,7 @@ [name]="name" [label]="formField.label" [placeholder]="formField.placeholder" + [initialValue]="formField.value" [required]="formField.isRequired" [labelHidden]="formField.labelHidden" [autocomplete]="formField.autocomplete" diff --git a/packages/ui/src/types/authenticator/form.ts b/packages/ui/src/types/authenticator/form.ts index ff54f2dbf0d..3909e256912 100644 --- a/packages/ui/src/types/authenticator/form.ts +++ b/packages/ui/src/types/authenticator/form.ts @@ -46,6 +46,8 @@ export interface FormFieldOptions { label?: string; /** Placeholder text */ placeholder?: string; + /** default value */ + value?: string; /** * @deprecated For internal use only, please use `isRequired` instead. */ From 781dcb02842d86736ffc675fe047970e2da0fafd Mon Sep 17 00:00:00 2001 From: Terry Gong Date: Tue, 5 Nov 2024 15:26:36 +1030 Subject: [PATCH 2/2] Update teh changeset --- .changeset/sour-onions-shout.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/sour-onions-shout.md diff --git a/.changeset/sour-onions-shout.md b/.changeset/sour-onions-shout.md new file mode 100644 index 00000000000..69b58db47d6 --- /dev/null +++ b/.changeset/sour-onions-shout.md @@ -0,0 +1,6 @@ +--- +'@aws-amplify/ui-angular': patch +'@aws-amplify/ui': patch +--- + +Add defalut value attribute to the form-field