Merge branch 'next' of https://github.com/shoelace-style/webawesome into konnorrogers/add-copy-buttons-to-swatches

This commit is contained in:
konnorrogers
2024-06-27 17:07:20 -04:00
2 changed files with 10 additions and 3 deletions

View File

@@ -836,10 +836,15 @@ export default class WaSelect extends WebAwesomeFormAssociatedElement {
placeholder=${this.placeholder}
.disabled=${this.disabled}
.value=${this.displayLabel}
?required=${this.required}
autocomplete="off"
spellcheck="false"
autocapitalize="off"
readonly
aria-invalid=${
!this.validity.valid
/** aria-invalid is required because readonly inputs are technically always valid so it never reads 'invalid data' for screen readers. */
}
aria-controls="listbox"
aria-expanded=${this.open ? 'true' : 'false'}
aria-haspopup="listbox"

View File

@@ -109,8 +109,8 @@ export class WebAwesomeFormAssociatedElement
validators: Validator[] = [];
// Should these be private?
@property({ state: true }) valueHasChanged: boolean = false;
@property({ state: true }) hasInteracted: boolean = false;
@property({ state: true, attribute: false }) valueHasChanged: boolean = false;
@property({ state: true, attribute: false }) hasInteracted: boolean = false;
// This works around a limitation in Safari. It is a hacky way for us to preserve custom errors generated by the user.
@property({ attribute: 'custom-error', reflect: true }) customError: string | null = null;
@@ -223,6 +223,7 @@ export class WebAwesomeFormAssociatedElement
return this.internals.form;
}
@property({ attribute: false, state: true, type: Object })
get validity() {
return this.internals.validity;
}
@@ -265,7 +266,7 @@ export class WebAwesomeFormAssociatedElement
}
this.internals.setValidity(flags, message, anchor || undefined);
this.requestUpdate('validity');
this.setCustomStates();
}
@@ -356,6 +357,7 @@ export class WebAwesomeFormAssociatedElement
!this.willValidate //
) {
this.resetValidity();
return;
}