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

MdDialog to target specific element #2253

Closed
mikimoresi opened this issue Aug 12, 2020 · 1 comment
Closed

MdDialog to target specific element #2253

mikimoresi opened this issue Aug 12, 2020 · 1 comment

Comments

@mikimoresi
Copy link
Contributor

mikimoresi commented Aug 12, 2020

Hello,
I have modified MdOverlay and MdDialog to add mdTarget prop.
In this way it is possible to make a dialog appear inside a specific element.
Passing in mdTarget prop an HTML element, the dialog and the overlay will appear in the given element and will not overlay the entire window.
Because of the position:fixed attribute that cannot target a specific element with position:relative, i have used position absolute both for MdDialog and MdOverlay in case of mdTarget exists. Plus, when mdTarget exists the overflow of the given element will be forced to "hidden" when dialog is active and go back in "auto" when dialog disappear.
The element in mdTarget MUST have position:relative

If you accept the proposal and maybe the commit (I am not allowed to commit) I will work on allowing the dialog to be scrollable if too long and maybe using a class on the mdTarget element instead of forcing the overflow style, this way anybody will be able to use that class for disable scrolling and doing any other desired thing like the required position:relative, the problem with this is that i would use pure js functions to add and remove classes while maybe there is some better approach, I will accept any suggestion.

Is my first commit ever on an open source project (shame on me) so I don't know exactly how contributions works. So please be patient if I'm doing something wrong :)

mikimoresi pushed a commit to mikimoresi/vue-material that referenced this issue Aug 12, 2020
mikimoresi pushed a commit to mikimoresi/vue-material that referenced this issue Aug 12, 2020
@mikimoresi
Copy link
Contributor Author

I have opened a pull request:
MdDialog to target specific element #2254

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

No branches or pull requests

1 participant