Skip to content

Commit

Permalink
fix(Dialog): add/remove overlay and scroll when fullscreen is changed (
Browse files Browse the repository at this point in the history
  • Loading branch information
KaelWD authored and johnleider committed Nov 23, 2018
1 parent cb605ac commit 76db39d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
13 changes: 10 additions & 3 deletions packages/vuetify/src/components/VDialog/VDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,22 @@ export default {
isActive (val) {
if (val) {
this.show()
this.hideScroll()
} else {
this.removeOverlay()
this.unbind()
}
},
fullscreen (val) {
if (val) this.hideScroll()
else this.showScroll()
if (!this.isActive) return

if (val) {
this.hideScroll()
this.removeOverlay(false)
} else {
this.showScroll()
this.genOverlay()
}
}
},

Expand Down Expand Up @@ -154,7 +162,6 @@ export default {
},
show () {
!this.fullscreen && !this.hideOverlay && this.genOverlay()
this.fullscreen && this.hideScroll()
this.$refs.content.focus()
this.$listeners.keydown && this.bind()
},
Expand Down
7 changes: 4 additions & 3 deletions packages/vuetify/src/mixins/overlayable.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ export default {

return true
},
removeOverlay () {
/** removeOverlay(false) will not restore the scollbar afterwards */
removeOverlay (showScroll = true) {
if (!this.overlay) {
return this.showScroll()
return showScroll && this.showScroll()
}

this.overlay.classList.remove('v-overlay--active')
Expand All @@ -81,7 +82,7 @@ export default {
this.overlay.parentNode.removeChild(this.overlay)
}
this.overlay = null
this.showScroll()
showScroll && this.showScroll()
} catch (e) { console.log(e) }

clearTimeout(this.overlayTimeout)
Expand Down

0 comments on commit 76db39d

Please sign in to comment.