diff --git a/CHANGELOG.md b/CHANGELOG.md index b3faa392..9c9eff69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,7 +59,7 @@ - plots/sliders/pads: reversed `logScale` behavior to match standard implementations; can be either `false` (disabled), `true` (logarithmic scale) or `number` (manual log scale, negative for exponential scale) - visualizer: added `framerate` property - menu: always centered menu - - modal: modals can't overflow their parents' (modal, tab, panel) boundaries + - modal: modals can't overflow parent modal/tab boundaries - input: removed `vertical` - pads, range: when `touchAddress` is set, one message per touched point is sent, in addition to the former touch state message - eq: removed `logScaleX` property, always draw logarithmic frequency response diff --git a/src/client/widgets/containers/modal.js b/src/client/widgets/containers/modal.js index 6f0318b8..cbfb5592 100644 --- a/src/client/widgets/containers/modal.js +++ b/src/client/widgets/containers/modal.js @@ -144,10 +144,11 @@ class Modal extends Panel { this.popup.classList.toggle('show', this.value) this.container.classList.toggle('on', this.value) - // this.setVisibility() this.bindEscKey(this.value) + if (this.init) this.fixParents() + if (this.value) { resize.check(this.widget, true) } @@ -157,6 +158,25 @@ class Modal extends Panel { if (options.sync) this.changed(options) + } + + fixParents() { + + var parent = this.parent, + scrollFixed = false + + while (parent && parent.props && !parent.getProp('type').match(/modal|tab|root/)) { + + // stacking + parent.container.style.zIndex = this.value ? 'initial' : '' + parent.container.style.contain = this.value ? 'style size' : '' + + parent = parent.parent + } + + this.container.style.contain = this.value ? 'style size' : '' + + } bindEscKey(set) {