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] v-dialog overlay still placed in root when using attach #6425

Closed
Paulsky opened this issue Feb 8, 2019 · 12 comments
Closed

[Bug Report] v-dialog overlay still placed in root when using attach #6425

Paulsky opened this issue Feb 8, 2019 · 12 comments
Assignees
Labels
C: VDialog VDialog T: bug Functionality that does not work as intended/expected
Milestone

Comments

@Paulsky
Copy link

Paulsky commented Feb 8, 2019

Versions and Environment

Vuetify: 1.5.0
Vue: 2.6.2
Browsers: Chrome 72.0.3626.81
OS: Windows 10

Steps to reproduce

Create a DOM element with a class/id. Create a VDialog and set the attach attribute with the selector. As described here at the 'attach' property: https://vuetifyjs.com/en/components/dialogs#attach

Expected Behavior

VDialog and the overlay have the target DOM element as parent. (this.$el.parentNode)

Actual Behavior

VDialog and overlay have the v-app DOM element as parent. (document.querySelector('[data-app]'))

Reproduction Link

https://codepen.io/Paulsky/pen/GzQZvX

@KaelWD
Copy link
Member

KaelWD commented Feb 8, 2019

Dialog is fine, it's just the overlay.

@KaelWD KaelWD added the T: bug Functionality that does not work as intended/expected label Feb 8, 2019
@Paulsky
Copy link
Author

Paulsky commented Feb 9, 2019

@KaelWD But shouldn't the dialog be in the center of the target DOM element? Instead of being in the center of the v-app?

@richdunajewski
Copy link

I agree, this seems broken with 1.5.6. The attach does not seem to work.

I expect the dialog and the overlay to be children of the selected element, so the dialog doesn't take over the entire app.

For background, I'm trying to overlay a section of the page with a "Loading..." modal similar to the example provided. I have a tabbed interface and I want the rest of the tabs to remain functional while the current tab is busy loading something. Right now, the entire app is overlaid, blocking the tabs from being usable.

@KaelWD KaelWD changed the title [Bug Report] V-Dialog Attach to DOM element [Bug Report] v-dialog overlay still placed in root when using attach Apr 18, 2019
@Olindholm
Copy link

Noticed this as well.

Any updates on when this will be fixed?

@Euthymos
Copy link

Hey there, I agree. IMO, this makes 'attach' quite useless. Any updates on this issue?

@KaelWD KaelWD self-assigned this Jan 10, 2020
@donaldma

This comment has been minimized.

@egidiocs

This comment has been minimized.

@jtomeck
Copy link

jtomeck commented Jul 23, 2020

I ran into this with the overlay of a v-bottom-sheet using v-model to activate it.

It's kind of a backwards workaround, but I got around the issue by creating a separate v-overlay with the absolute prop inside my v-navigation-drawer, as well as using hide-overlay on the bottom-sheet itself. I then added v-if="yourModel" to the overlay to activate it at the same time as the bottom sheet. I hope this helps with the v-dialog issue as well.

https://codepen.io/jradicus/pen/yLewOOm

That said, I do still feel that this is a bug and the workaround should not be necessary.

@iaverdieck
Copy link

You can also set the position attribute of the dialog on your own. This will do it:
.v-dialog__content { position: absolute; }

sudhakar-s pushed a commit to sudhakar-s/vuetify that referenced this issue Nov 3, 2020
sudhakar-s pushed a commit to sudhakar-s/vuetify that referenced this issue Nov 3, 2020
@c-harding
Copy link

You can also set the position attribute of the dialog on your own. This will do it:
.v-dialog__content { position: absolute; }

It would be good if we could directly provide our own class to the div.v-dialog__content (e.g. with an container-class= attribute), as it feels rather like exploiting an implementation detail to style .v-dialog__content (which is undocumented) directly.

@hpo14
Copy link

hpo14 commented Nov 20, 2020

You can also set the position attribute of the dialog on your own. This will do it:
.v-dialog__content { position: absolute; }

i ran into the same issue too.

With the following code, the dialog can correctly show in the child component

<template>
...
<v-dialog :attach="true">...</v-dialog>
..
</template>
<style scoped>
.v-dialog__content { position: absolute; }
</style>

@nyszilard
Copy link

nyszilard commented Jan 18, 2021

Are there any news? It still doesn't work for me.

I ran into this with the overlay of a v-bottom-sheet using v-model to activate it.

It's kind of a backwards workaround, but I got around the issue by creating a separate v-overlay with the absolute prop inside my v-navigation-drawer, as well as using hide-overlay on the bottom-sheet itself. I then added v-if="yourModel" to the overlay to activate it at the same time as the bottom sheet. I hope this helps with the v-dialog issue as well.

https://codepen.io/jradicus/pen/yLewOOm

That said, I do still feel that this is a bug and the workaround should not be necessary.

@jtomeck
I've tried your solution with other components, but it doesn't seem to work with them:
https://codepen.io/szili303/pen/ZEpwJPb

@KaelWD KaelWD added this to the v3.0.0 milestone May 20, 2021
KaelWD added a commit that referenced this issue May 26, 2021
Closes #1068
Closes #4807 (class now applies to the root teleported element)
Fixes #6425
Closes #6764
Fixes #7422
Closes #8105
Closes #9595
Fixes #9632
Fixes #11263
@KaelWD KaelWD closed this as completed May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VDialog VDialog T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.