question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

b-modal specify class for modal outer

See original GitHub issue

Current Issue

Currently there is a way of specifying modal-class but not to specify its outer element _modal_outer_ (the element with the z-index and position absolute on it)

This is an issue if you’d like to add a specific wrapper class to encapsulate stylings when embedding in a 3rd party page.

Possible solution

One solution would be add a prop name called modal-outer-classthat can be used to specify a class name.

Only two code changes would be needed. One to add the class as a property on b-modal vue component:

https://github.com/bootstrap-vue/bootstrap-vue/blob/dev/src/components/modal/modal.js

Above Line number 160:

  modalOuterClass: {
    type: [String, Array, Object],
    default: null
  },

Then add it to the component

Line number 379:

    modalOuterStyle() {
      // Styles needed for proper stacking of modals
      return {
        class: this.modalOuterClass,
        position: 'absolute',
        zIndex: this.zIndex
      }
    },

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
gfolivercommented, Apr 13, 2020

@fl-frontend You can add an id to the <b-modal id="example"> and the modal_outer id will be replaced to <div id="example___BV_modal_outer_" style="position: absolute; z-index: 1040;">. You can reference it in css with #example___BV_modal_outer_

0reactions
stale[bot]commented, Jul 19, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Modal - Bootstrap
Use Bootstrap's JavaScript modal plugin to add dialogs to your site for lightboxes, user notifications, or completely custom content.
Read more >
Modal | Components - BootstrapVue
Modals are streamlined, but flexible dialog prompts powered by JavaScript and CSS. They support a number of use cases from user notification to...
Read more >
Exposing element outside modal-backdrop in CSS Bootstrap ...
<div id="outside-element"> I want this element exposed even while the modal is active, upon clicking the button in the modal dialog box ...
Read more >
W3.CSS Modal - W3Schools
The w3-modal class defines a container for a modal. The w3-modal-content class defines the modal content. Modal content can be any HTML element...
Read more >
Considerations for Styling a Modal | CSS-Tricks
Keyboard focus should be trapped inside of the modal, so the user does not accidentally tab outside of the modal (a.k.a. “escaping the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found