Skip to content

Commit 1864d58

Browse files
Merge pull request #622 from dxc-technology/passwordFix
[Patch] Fixing password uncontrolled event
2 parents 87dbbe1 + 3358334 commit 1864d58

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

projects/dxc-ngx-cdk/src/lib/dxc-password-input/dxc-password-input.component.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,18 @@ export class DxcPasswordInputComponent implements OnInit, OnChanges {
141141
}
142142

143143

144-
handleOnChange(event) {
144+
handleOnChange({value, error}) {
145145
this.cdRef.detectChanges();
146-
this.onChange.emit(event);
146+
this.onChange.emit({value, error});
147147
this.controlled
148148
? (this.dxcInputRef.inputRef.nativeElement.value = this.value)
149-
: (this.value = event);
149+
: (this.value = value);
150150
}
151151

152-
handleOnBlur(event) {
153-
this.onBlur.emit({ value: event.value, error: event.error });
152+
handleOnBlur({value, error}) {
153+
this.onBlur.emit({ value: value, error: error });
154154
if (!this.controlled) {
155-
this.value = event.value;
155+
this.value = value;
156156
this.cdRef.detectChanges();
157157
}
158158
}

0 commit comments

Comments
 (0)