-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Model window ( including dialogue ) open and right side scroll …
…bar of browser disappears #864
- Loading branch information
1 parent
b89b060
commit 035be32
Showing
1 changed file
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ import Platform from '../../features/platform' | |
import EscapeKey from '../../features/escape-key' | ||
import extend from '../../utils/extend' | ||
import { QTransition } from '../transition' | ||
import { getScrollbarWidth } from '../../utils/scroll' | ||
const positions = { | ||
top: 'items-start justify-center with-backdrop', | ||
|
@@ -156,8 +157,12 @@ export default { | |
return | ||
} | ||
document.body.appendChild(this.$el) | ||
document.body.classList.add('with-modal') | ||
const body = document.body | ||
body.appendChild(this.$el) | ||
body.classList.add('with-modal') | ||
this.bodyPadding = window.getComputedStyle(body).paddingRight | ||
body.style.paddingRight = `${getScrollbarWidth()}px` | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
rstoenescu
Author
Member
|
||
EscapeKey.register(() => { | ||
if (this.noEscDismiss) { | ||
return | ||
|
@@ -186,7 +191,8 @@ export default { | |
setTimeout(() => { | ||
if (!openedModalNumber) { | ||
document.body.classList.remove('with-modal') | ||
body.classList.remove('with-modal') | ||
body.style.paddingRight = this.bodyPadding | ||
} | ||
if (typeof this.__onClose === 'function') { | ||
this.__onClose() | ||
|
@rstoenescu I agree that hiding the bar to avoid the scroll is interesting, however this paddingRight is not an interesting behavior .. in this case I suggest you just remove this functionality
This 15px space remains underneath the overlay, maybe aesthetically it does not look cool