-
Notifications
You must be signed in to change notification settings - Fork 1
Description
clearTimeout before setting a new one to avoid multiple effect
Whenever any attribute is changed, a new timer for autoHide gets set without clearing the previous one.
Lines 252 to 267 in bade5d3
| updated(changedProperties) { | |
| if (changedProperties.has('visible')) { | |
| this.handleSlotContent(); | |
| } | |
| if (changedProperties.has('variant')) { | |
| clearTimeout(this.fadeOutTimer); | |
| } | |
| // do not auto dismiss for error toasts or if disableAutoHide is set | |
| if (this.visible && !this.disableAutoHide && this.variant !== 'error') { | |
| this.fadeOutTimer = setTimeout(() => { | |
| this.fadeOutToast(); | |
| }, TIME_TIL_FADE_OUT); | |
| } | |
| } | |
Originally posted by @sun-mota in #67 (comment)
Metadata
Metadata
Assignees
Labels
No labels