fix(component): toast duration (#1732)
This commit is contained in:
1 parent
6917d2100f
commit
f18127dfd6
2 files changed
+7
-3
No files matched your search
@@ -57,7 +57,7 @@ export type ToastOptions = {
|
||||
*/
|
||||
export const toast = (
|
||||
message: string,
|
||||
{ duration, portal }: ToastOptions = {
|
||||
{ duration = 2500, portal }: ToastOptions = {
|
||||
duration: 2500,
|
||||
}
|
||||
) => {
|
||||
@@ -107,8 +107,9 @@ export const toast = (
|
||||
element.style.margin = '0';
|
||||
element.style.padding = '0';
|
||||
// wait for transition
|
||||
await sleep(230);
|
||||
element.remove();
|
||||
element.addEventListener('transitionend', () => {
|
||||
element.remove();
|
||||
});
|
||||
}, duration);
|
||||
return element;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user