Fullscreen mobile modal: how hard can it be?
github.com
github.com
Please make it clear that a dialog is a dialog.
I am not sure but from the name of the repo I am guessing this is referring to React JavaScript framework which I think is purely "single page application" deal which would explain the limitation of not being able to load a separate page.
Shame we are reimplementing the wheel for such trivial and basic use-cases. Oh well.
In this particular case I feel "modal" is an implementation detail - as long as you don't break the UX contracts (i.e. browser history is left unchanged and page state under modal is remembered) does it matter how you achieve the modal-like behaviour?
In this particular case, it could be easier to render the modal using some HTML and/or CSS and hold onto whatever state was underneath - if you're using React, there's no reason to not transition to a different page and either pass the state to the next component OR use something like Redux so you can recall application state.
I feel like the hazard here is that many developers don't know, care about, or care about knowing, the full extent of the UX contract, and as a result implement something that's only halfway there.
My go-to example of this is one of the Java UI toolkit of old, which reimplemented all controls but tried to make them look as if they were native. The end result was a set of controls that kind-of looked like native ones, except they didn't support appropriate context menus and less-known keyboard shortcuts.
Either way, though, this does feel like an odd problem to be trying to solve. If you already are a JS app, just handle the blur events to stop them from going to another part of your page. The browser will still let them close the page (or the entire browser), but you can control the UX within your own app.
Whether or not that is a good idea is also a valid discussion. Because if you have to go to such lengths to get the UX you want on a mobile device, odds are you are going to end up with a sub-optimal UX, as mobile apps mostly match conventions.
The solutions seem to be trying to solve this for a normal HTML page without changing page, which is a harder problem.
> The solutions seem to be trying to solve this for a normal HTML page without changing page, which is a harder problem.
This is a very good point. In an actual spa there is no reason to overlay the modal rather than create a new route
I leave almost any site that interrupts me with a full screen modal dialog, especially if it's a prompt to subscribe to a newsletter. This abuse has become the norm. I have even seen desktop software adopting this behavior. A licensed copy of Guitar Pro 6 will interrupt you with a fullscreen ad for Guitar Pro 7. Unforgivable. Respect what the user is there for, and you might earn their business.
Edit: I recognize that there are some positive, responsible uses for this technique (extending forms/controls; search suggestions, assist the user rather than interrupt) and good examples are shown here. Please excuse the Sunday rant.
It’s completely reasonable for a product to advertise for a newer version. How else would you know there’s a new version that you might actually decide you want to buy? And you don’t have to buy it.
No argument from me there. A notice on the splash screen, even a tool tip at start-up would work fine, but it was a full screen advertisement, several minutes after start-up, which stopped playback (!) without warning. These interruptions are what I find completely unacceptable, and I believe they stem from fundamentally misunderstanding what the user is there for, or outright disrespect.
Advertising's role is chiefly to create demand and manipulate people into buying things, not to inform.
If one is not looking for new versions, then they very likely don't need them.
Just use a separate page.
This code is exactly what you would need to spoof users if you got JS execution on a host that isn't yours.
I would expect that when you tinker a bit with plain CSS, you will find a simple solution.
I feel like mobile design has slowly become "do it the designer's way or you're wrong" and give it another 5-10 years before it swings back around to "Oh god, what were we doing taking away the user's choice for all those years?"
Actually css-tricks did investigate how many people adjust font size on mobile and it wasn't quite 'nobody' but it was rounding error. When it comes to desktop an anecdotal walk around the office will give you the answer - lots of people change their desktop resolution to make it legible.
With a full screen mobile modal you just want to get an interaction from the user of the yes/no variety, if keyboard needed then that will be for a simple code or name that is possibly auto-filled. There is no more to it than that - it is a modal.
On the desktop the 'correct' tool for this job is actually the 'alert box' but these got abused and 'designers' complained that they could not 'style' the things. Hence we now have frontend developers load loads of useless libraries and spend however long styling these things so that people can subscribe to newsletters they will never read.
Hence, for the use case of 'modal dialog boxes' the rules of regular content do not apply. You aren't going to get extra doodads that distract the user away from the task in hand. It is just not needed.
What next, vending machines where, prior to buying your snack item you can choose fonts and colours of the 'insert coin' display?
I'd never adjust my phone's font size - I pinch zoom, literally, every page I visit that allows me to do so on my phone because it's a very selective zoom. It allows me to focus on one part of the site, read small text in just one section (where the text in other sections might be fine), or makes it easier to click a link, button, or what have you. I'm not talking about adjusting font size - I'm talking about zooming. Almost nobody mucks around with settings, it's something like 5%~ of people change the default settings and the other 95%~ never change a thing.
Being able to change the font size of a modal is about usability [0]. If I can't zoom in on the tiny font because they've broken pinch zooming in order to place the modal on the page I'm closing the site.
ps. The actual proper way to do this is with a dialog modal [1]
[0] https://www.growingwiththeweb.com/2013/01/let-me-pinch-to-zo...
[1] https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogE...
I am blessed to work for a company where web standards, accessibility, and page load speed are considered more important than the whims of my millennial boss, or the marketing department.
That's not to say I don't have my share of "I want this to look like a web site that I would want to visit" and "Can you do this cool thing like TMZ?" moments. I remind them that we don't make web sites for them or me, but for our visitors.
If that doesn't work, I pull out the memos showing that the legal department is on my side, and somehow groks the whole web bloat problem.
Can't wait to finally deploy the new site and replace the old JS/SPA + library + framework + polyfill + jquery + ... + ... + ... site the last guy built.
It seems so basic but it’s not straight forward at all to implement in a consistent way across browsers. After trying for a while myself, and not wanting to sink days into it, I’ve given up on finding the perfect solution for now. Going to try the 4th step here, but I believe there’s always a new modal bug waiting to be discovered.