Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unmaximizing and hiding QDialog doesn't clean up properly, breaking scroll #6739

Closed
makkrnic opened this issue Apr 4, 2020 · 3 comments
Closed
Assignees

Comments

@makkrnic
Copy link

makkrnic commented Apr 4, 2020

Describe the bug
If maximized and value are changed from true to false simultaneously, q-body--dialog class is left on <body> breaking the scrolling behavior.

Codepen/jsFiddle/Codesandbox (required)
https://jsfiddle.net/mkrnic/suxbLgaj/8/

To Reproduce

  1. Try scrolling to ensure it's ok
  2. Click "Show" button
  3. Click "Hide" button in the popup
  4. Try scrolling and observer the body classes printed on screen

Expected behavior
<body> shouldn't have q-body--dialog class after closing the dialog.

Platform (please complete the following information):
OS: Linux
Node: any
NPM:any
Yarn: any
Browsers: Chrome
iOS:
Android:
Electron:

Additional context
Looks very similar to #5798

@thugic
Copy link

thugic commented Apr 5, 2020

+1 for this.

I noticed the same behaviour triggering QDialog from Vuex actions.

Strangely enough, if I close the QDialog triggering the mutation from within the QDialog component scroll is being restored.

Example:

// Inside my QDialog component
<template>
<q-dialog>
<q-btn @click="closeMe" />
// .....
</template>
<script>
closeMe() {
this.$store.commit('dialogs/MyDialog', 'close')
</script>

Instead, if I submit a form within the QDialog, using a Vuex action, and inside that action try to

commit('dialogs/MyDialog', 'close', {root: true})

QDialog gets closed as it should, but the underlaying page is not scrollable anymore. Even if navigation to other pages/layouts.

Strangely enough, in my case the body class gets restored to desktop no-touch body--light but scrolling is still not possible.

If I inspect my page, and check for event listeners, I can see there's an event called wheel. If I toggle (enable) the Toggle Passive option on that event, I can scroll the page again...

This event is being referenced in prevent-scroll.js.

Platform (please complete the following information):
OS: MacOS / iPad iOS
Node: any
NPM:any
Yarn: any
Browsers: Chrome / Safari
iOS:
Android: ** It appears to be working as expected on Android Chrome **
Electron:

@thugic
Copy link

thugic commented Apr 5, 2020

Edit:

What I tried, and apparently worked:

in src/mixins/prevent-scroll.js line: 120:

  • changed: window[`${action}EventListener`]('wheel', onWheel, listenOpts.notPassive)
  • to: window[`${action}EventListener`]('wheel', onWheel, listenOpts.passiveCapture)

But I am not sure this will affect some other behaviour ...

@rstoenescu
Copy link
Member

Hi,

Thanks for reporting.
Fix will be available in "quasar" v1.9.13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants