mirror of
https://github.com/filamentphp/filament.git
synced 2026-10-24 23:35:30 +08:00
Prevent notification closing if mouse over notification
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -25,7 +25,14 @@ export default (Alpine) => {
|
||||
notification.duration &&
|
||||
notification.duration !== 'persistent'
|
||||
) {
|
||||
setTimeout(() => this.close(), notification.duration)
|
||||
setTimeout(() => {
|
||||
if (! this.$el.matches(':hover')) {
|
||||
this.close()
|
||||
return
|
||||
}
|
||||
|
||||
this.$el.addEventListener('mouseleave', () => this.close())
|
||||
}, notification.duration)
|
||||
}
|
||||
|
||||
this.isShown = true
|
||||
|
||||
Reference in New Issue
Block a user