Skip to content

Commit

Permalink
fix(b-modal): delay initially open modal via nextTick when using v-mo…
Browse files Browse the repository at this point in the history
…del or visible prop (#3320)

* fix(modal): delay initially open modal via nextTick when using v-model or visible prop


When modal is set to be initially open on mount, delay the show in a `$nextTick()` to ensure DOM is fully loaded

Addresses #3312 (comment)

* Update modal.js

* Update modal.js
  • Loading branch information
tmorehouse authored and jacobmllr95 committed May 18, 2019
1 parent 88b1cfd commit 6f3010a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/modal/modal.js
Expand Up @@ -343,7 +343,7 @@ export default Vue.extend({
this.listenOnRoot('bv::modal::show', this.modalListener)
// Initially show modal?
if (this.visible === true) {
this.show()
this.$nextTick(this.show)
}
},
beforeDestroy() {
Expand Down Expand Up @@ -401,7 +401,7 @@ export default Vue.extend({
// Show the modal
this.doShow()
},
hide(trigger) {
hide(trigger = '') {
if (!this.is_visible || this.is_closing) {
/* istanbul ignore next */
return
Expand Down

0 comments on commit 6f3010a

Please sign in to comment.