modal/popup: prevent touch event from affecting elements behind the popup when closing it (#228)
This commit is contained in:
parent
ce7fa242b9
commit
303a895df0
3 changed files with 5 additions and 1 deletions
|
|
@ -36,7 +36,8 @@ module.exports = {
|
|||
`)
|
||||
|
||||
if (this.closable) {
|
||||
DOM.get(this.html, '.popup-title .closer')[0].addEventListener('fast-click', ()=>{
|
||||
DOM.get(this.html, '.popup-title .closer')[0].addEventListener('fast-click', (e)=>{
|
||||
e.detail.preventDefault = true
|
||||
this.close()
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ module.exports = class Modal extends Panel {
|
|||
this.popup.style.setProperty('--height', height)
|
||||
|
||||
DOM.get(this.popup, '.closer')[0].addEventListener('fast-click', (e)=>{
|
||||
e.detail.preventDefault = true
|
||||
this.setValue(0, {sync:true, send:true})
|
||||
})
|
||||
|
||||
|
|
@ -99,6 +100,7 @@ module.exports = class Modal extends Panel {
|
|||
|
||||
this.popup.addEventListener('fast-click',(e)=>{
|
||||
if (e.target == this.popup && this.value == 1) {
|
||||
e.detail.preventDefault = true
|
||||
this.setValue(0, {sync:true, send:true})
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue