File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/uui-base/lib/mixins Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,9 @@ export const UUIFormControlMixin = <
180
180
public get pristine ( ) : boolean {
181
181
return this . _pristine ;
182
182
}
183
- private _pristine : boolean = true ;
183
+ // Will be set to true instantly to trigger the setAttribute in the setter.
184
+ // This is to prevent an issue caused by using setAttribute in the constructor.
185
+ private _pristine : boolean = false ;
184
186
185
187
/**
186
188
* Apply validation rule for requiring a value of this form control.
@@ -221,7 +223,7 @@ export const UUIFormControlMixin = <
221
223
constructor ( ...args : any [ ] ) {
222
224
super ( ...args ) ;
223
225
this . _internals = this . attachInternals ( ) ;
224
- this . setAttribute ( ' pristine' , '' ) ;
226
+ this . pristine = true ;
225
227
226
228
this . addValidator (
227
229
'valueMissing' ,
You can’t perform that action at this time.
0 commit comments