fix(scrolling): fix body scrollable when modal is open (#681)
Fixes #680
This commit is contained in:
parent
e3debcc5e1
commit
f0b3115be1
|
@ -120,6 +120,9 @@
|
||||||
.muted-style.modal-dialog-contents {
|
.muted-style.modal-dialog-contents {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
:global(body.modal-open) {
|
||||||
|
overflow-y: hidden;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
import { A11yDialog } from '../../../_thirdparty/a11y-dialog/a11y-dialog'
|
import { A11yDialog } from '../../../_thirdparty/a11y-dialog/a11y-dialog'
|
||||||
|
@ -132,6 +135,7 @@
|
||||||
this._a11yDialog = new A11yDialog(dialogElement)
|
this._a11yDialog = new A11yDialog(dialogElement)
|
||||||
this._a11yDialog.on('hide', () => {
|
this._a11yDialog.on('hide', () => {
|
||||||
let { id } = this.get()
|
let { id } = this.get()
|
||||||
|
document.body.classList.toggle('modal-open', false)
|
||||||
this.fire('close')
|
this.fire('close')
|
||||||
this._a11yDialog.destroy()
|
this._a11yDialog.destroy()
|
||||||
emit('destroyDialog', id)
|
emit('destroyDialog', id)
|
||||||
|
@ -172,6 +176,7 @@
|
||||||
if (id !== thisId) {
|
if (id !== thisId) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
document.body.classList.toggle('modal-open', true)
|
||||||
this._a11yDialog.show()
|
this._a11yDialog.show()
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
this.set({ fadedIn: true })
|
this.set({ fadedIn: true })
|
||||||
|
|
Loading…
Reference in a new issue