Skip to content
Merged
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
6 changes: 4 additions & 2 deletions packages/uui-base/lib/mixins/FormControlMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ export const UUIFormControlMixin = <
public get pristine(): boolean {
return this._pristine;
}
private _pristine: boolean = true;
// Will be set to true instantly to trigger the setAttribute in the setter.
// This is to prevent an issue caused by using setAttribute in the constructor.
private _pristine: boolean = false;

/**
* Apply validation rule for requiring a value of this form control.
Expand Down Expand Up @@ -221,7 +223,7 @@ export const UUIFormControlMixin = <
constructor(...args: any[]) {
super(...args);
this._internals = this.attachInternals();
this.setAttribute('pristine', '');
this.pristine = true;

this.addValidator(
'valueMissing',
Expand Down