Having a full screen dialog really is a huge improvement for mobile.
But it really really needs to support the Back button. It's so counter intuitive for users when they hit the back button on their mobile and navigate them the actual page they were on.
Is it hard to add this because of the different routers used ?
It's outside of the scope of the library. You need to wire the open state with the URL.
@oliviertassinari ok thanks.
Will search for an example of how to do that online.
I almost thought about this issue at the same time as you @gedw99! ^^
If you find something nice, could you please share it here ? :)
Anyone solve this? Cbf coding from scratch 馃槃
Any solution for this?
I'm a bit confused because the mUI docs for the Dialog example state that:
Touching outside of the dialog, or pressing Back, cancels the action and closes the dialog
But this does not appear to be the case?
@JulesAU Indeed I think this sentence is not correct.
I've made a demo that binds the open state with the location hash, like this, clicking the back button works as expected: https://codesandbox.io/s/material-demo-7zf07 (the back button does not seem to work as expected in Codesandbox preview, but if you open the result on a dedicated page, it works as expected: https://7zf07.codesandbox.io)
@oliviertassinari do you think this could be added to the docs?
@ValentinH Thanks for sharing your demo. I believe this issue is enough as documentation.
Most helpful comment
@JulesAU Indeed I think this sentence is not correct.
I've made a demo that binds the open state with the location hash, like this, clicking the back button works as expected: https://codesandbox.io/s/material-demo-7zf07 (the back button does not seem to work as expected in Codesandbox preview, but if you open the result on a dedicated page, it works as expected: https://7zf07.codesandbox.io)
@oliviertassinari do you think this could be added to the docs?