Skip to content
Permalink
Browse files

feat(b-modal): add scoped style support when portalled (non-static mo…

…dal) (#3962)
  • Loading branch information...
tmorehouse committed Aug 28, 2019
1 parent 0d1961c commit 77ad6b92e5cc11454fee8fa6c86eccb8b8abcd6f
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/components/modal/modal.js
@@ -987,13 +987,21 @@ export const BModal = /*#__PURE__*/ Vue.extend({
}
backdrop = h(BVTransition, { props: { noFade: this.noFade } }, [backdrop])

// If the parent has a scoped style attribute, and the modal
// is portalled, add the scoped attribute to the modal wrapper
const $parent = this.$parent
const scopeAttrs =
!this.static && $parent && $parent.$options._scopeId
? { [`${[$parent.$options._scopeId]}`]: '' }
: {}

// Assemble modal and backdrop in an outer <div>
return h(
'div',
{
key: `modal-outer-${this._uid}`,
style: this.modalOuterStyle,
attrs: { ...this.$attrs, id: this.safeId('__BV_modal_outer_') }
attrs: { ...scopeAttrs, ...this.$attrs, id: this.safeId('__BV_modal_outer_') }
},
[modal, backdrop]
)

0 comments on commit 77ad6b9

Please sign in to comment.
You can’t perform that action at this time.