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

[Bug Report] Dialog won't behave as modal when hide-overlay prop is true #8697

Closed
wallslide opened this issue Aug 23, 2019 · 13 comments · Fixed by #9304 or drakeg/vue_learn#9
Closed
Labels
C: VDialog T: bug Functionality that does not work as intended/expected T: regression Something that used to work but we broke

Comments

@wallslide
Copy link

Environment

Vuetify Version: 2.0.10
Vue Version: 2.6.10
Browsers: Chrome 76.0.3809.100
OS: Windows 10

Steps to reproduce

Set both the persistent and hide-overlay props to true on a Dialog

Expected Behavior

The Dialog will persist even when the user clicks outside of it.

Actual Behavior

The Dialog gets dismissed when the user clicks outside of it.

Reproduction Link

https://codepen.io/wallslide/pen/BaBpZbR

@ghost ghost added the S: triage label Aug 23, 2019
@KaelWD
Copy link
Member

KaelWD commented Aug 23, 2019

Related: #8640

@KaelWD KaelWD added C: VDialog T: bug Functionality that does not work as intended/expected T: regression Something that used to work but we broke and removed S: triage labels Aug 23, 2019
@FelixINX
Copy link

FelixINX commented Sep 3, 2019

I think the problem is in the following bit :

if (this.persistent && this.overlay) {
if (
!this.noClickAnimation &&
(
this.overlay.$el === target ||
this.overlay.$el.contains(target)
)
) this.animateClick()
return false
}

It probably broke on v2.0.8 (652ba11) when this.overlay was added as a requirement for this function.

@LujienZ
Copy link

LujienZ commented Sep 9, 2019

I reproduce the same issue with Persistent and Fullscreen.

Reproduction Link
Work: (Just click on pin)
https://codepen.io/lujienz/pen/KKPozgw
Does not work : (Just click on pin)
https://codepen.io/lujienz/pen/VwZXaKx

@Zyles
Copy link

Zyles commented Sep 16, 2019

I have this problem. The overlay stays even tho I close the dialog.

@ErikMikkelson
Copy link
Contributor

ErikMikkelson commented Oct 7, 2019

Here's a workaround for people wanting to use bottom sheet with persist and hide-overlay in the meantime.. We extend VBottomSheet with a new control that operates correctly. The export as any makes it work with vue-property-decorator.

import { VBottomSheet } from "vuetify/lib";

export default {
    extends: VBottomSheet,

    methods: {
        closeConditional(_e: Event) {
            return false;
        }
    }
} as any;

@depsimon
Copy link

depsimon commented Oct 8, 2019

Thanks @ErikMikkelson this made the trick!

@depsimon
Copy link

Also, it might be useful to override the hideScroll() method to let the user scroll in the interface.

MajesticPotatoe pushed a commit that referenced this issue Oct 24, 2019
#9304)

* fix(vdialog): fix close on outside click with persist and hide-overlay

Fixes an issue where VDialog would close on outside clicks if persist and hide-overlay were set.

fix #8697

* fix(vdialog): persistent and hide-overlay should ignore outside click

ixes an issue where the dialog would still close on outside clicks when persistent and hide-overlay

fix #8697
@wussup
Copy link

wussup commented Dec 2, 2019

Still not working, version 2.1.12.

<v-bottom-sheet v-model="sheet"
                  scrollable
                  hide-overlay
                  persistent>
    <v-card>...</vcard>
</v-bottom-sheet>

When I click outside the dialog, then the dialog is clothing.

Any thoughts?

EDIT:
My bad, I placed v-bottom-sheet in the wrong place.

@jacekkarczmarczyk
Copy link
Member

This issue have been fixed, please create a new one for bottom sheet problem

@alexandruradovici
Copy link

I have created an issue (#9242) for some time for this problem, should I reopen it or create a new one?

@jacekkarczmarczyk
Copy link
Member

@alexandruradovici
Copy link

alexandruradovici commented Dec 2, 2019 via email

@nikilp
Copy link

nikilp commented Mar 31, 2020

when both persistent and hide-overlay are set, the page can be scrolled, which i believe is not the intended case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VDialog T: bug Functionality that does not work as intended/expected T: regression Something that used to work but we broke
Projects
None yet