Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/components/GenericModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ export default {
type: Boolean,
default: true,
},
allowInnerScroll: {
type: Boolean,
default: false,
},
},
data() {
return {
Expand Down Expand Up @@ -168,7 +172,7 @@ export default {
// make sure PortalVue is ready
await this.$nextTick();
// lock scroll
scrollLock.lockScroll(this.$refs.container);
scrollLock.lockScroll(this.$refs.container, this.allowInnerScroll);
// remember last focus item
await this.focusCloseButton();
// update the focus container
Expand Down
1 change: 1 addition & 0 deletions src/components/Navigator/QuickNavigationModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<template>
<GenericModal
isFullscreen
allowInnerScroll
:showClose="false"
:visible.sync="isVisible"
backdropBackgroundColorOverride="rgba(0, 0, 0, 0.7)"
Expand Down
7 changes: 4 additions & 3 deletions src/utils/scroll-lock.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,12 @@ export default {
* Locks the scrolling of the body, except for an element
* @param {HTMLElement} targetElement
*/
lockScroll(targetElement) {
lockScroll(targetElement, allowInnerScroll) {
// skip lock if already locked
if (isLocked) return;
// iOS devices require a more advanced locking.
if (!isIosDevice()) {
// use simple lock if device is not iOS
// or it allows inner scrolling
if (!isIosDevice() || allowInnerScroll) {
simpleLock();
} else {
advancedLock(targetElement);
Expand Down