mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 12:09:26 +00:00
revert dropdown / input
This commit is contained in:
@@ -295,9 +295,9 @@ export default class WaDropdown extends WebAwesomeElement {
|
||||
|
||||
// Either the tag hasn't registered, or it hasn't rendered.
|
||||
// So, wait for the tag to register, and then try again.
|
||||
if (target === undefined || target === null) {
|
||||
if (target === undefined) {
|
||||
customElements.whenDefined(tagName).then(async () => {
|
||||
await (accessibleTrigger as WaButton | WaIconButton).updateComplete;
|
||||
await (target as WaButton | WaIconButton).updateComplete;
|
||||
this.updateAccessibleTrigger();
|
||||
});
|
||||
|
||||
|
||||
@@ -260,20 +260,13 @@ export default class WaInput extends WebAwesomeFormAssociatedElement {
|
||||
return;
|
||||
}
|
||||
|
||||
const formElements = [...form.elements];
|
||||
const button = [...form.elements].find((el: HTMLButtonElement) => el.type === 'submit' && !el.disabled) as
|
||||
| undefined
|
||||
| HTMLButtonElement
|
||||
| WaButton;
|
||||
|
||||
// If this is the only element in the form, submit the form.
|
||||
if (formElements.length === 1) {
|
||||
form.requestSubmit(null);
|
||||
return;
|
||||
}
|
||||
|
||||
const button = formElements.find(
|
||||
(el: HTMLButtonElement) => el.type === 'submit' && !el.matches(':disabled')
|
||||
) as undefined | HTMLButtonElement | WaButton;
|
||||
|
||||
// If there's no submit buttons, don't submit the form.
|
||||
if (!button) {
|
||||
form.requestSubmit(null);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user