mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 20:19:13 +00:00
Fix promise return values
This commit is contained in:
@@ -126,7 +126,7 @@ export class Alert {
|
||||
*/
|
||||
@Method()
|
||||
async toast() {
|
||||
return new Promise(resolve => {
|
||||
return new Promise<void>(resolve => {
|
||||
if (!toastStack.parentElement) {
|
||||
document.body.append(toastStack);
|
||||
}
|
||||
|
||||
@@ -224,12 +224,12 @@ export class ColorPicker {
|
||||
async reportValidity() {
|
||||
// If the input is invalid, show the dropdown so the browser can focus on it
|
||||
if (!this.inline && this.input.invalid) {
|
||||
return new Promise(resolve => {
|
||||
return new Promise<void>(resolve => {
|
||||
this.dropdown.addEventListener(
|
||||
'sl-after-show',
|
||||
() => {
|
||||
this.input.reportValidity();
|
||||
resolve(null);
|
||||
resolve();
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user