Push dialogs
#4210
Replies: 1 comment 1 reply
-
Yeah that's cool. I'd love it if they integrated this. Just a note, I think (not completely sure) that dialog actions are meant to be text buttons. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey! I can't find a good name for that, I call that feature "push dialog" because it uses
pushState
of the history API.I had to implement that in a project when I was using
mwc-dialog
and now I am thinking to implement that again.The idea is simple, sometimes you want to dismiss a dialog going one page back in history. This is particularly true when the dialog is big and complex and when it feels like a page itself. It's even more true now that
md-dialog
is providing thefullscreen
attribute, and truer if the user uses navigation gestures on mobile devices (It's faster to swipe any border than trying to hit a button, also it may just be instinctive).I made a demo here : https://vdegenne.github.io/push-dialog-demo
(it may not work on mobile devices... but it's just to demonstrate the idea)
In the demo I am just using a utility function:
https://github.com/vdegenne/push-dialog-demo/blob/58260b366eb61c90a4cd135ca8a5960f2270d08c/src/push-dialog.ts#L3
But ideally this could be an attribute on the element:
What do you guys think? This is just an idea I am sharing.
Beta Was this translation helpful? Give feedback.
All reactions