is it an abuse of the html dialog modal to use it for mobile navigation?

#webdev #html #css

pen: https://codepen.io/blackspike/pen/LYXbRPj?editors=1100

dialog-mobile-menu

...

CodePen
@felixthehat I always feel itโ€™s a bit wrong somehow to use modal navigation on a mobile... but it could work with a small menu
@felixthehat Admittedly, I am not an expert on accessibility and screen readers, (or even the intricacies of the dialog element for that matter) but that's one thing I'd be concerned about in this case. I know you can prevent users from interacting with elements outside the dialog, but does that behaviour work with screen readers as well? If we use a <nav> element, would a screen reader know that the navigation for the page exists inside the dialog (when the modal is closed)?
@pxplowsound I believe (and I need to research this) but I believe the killer feature of native html dialog is that a11y is baked in at a browser level rather than the usual diy pile of aria hacks. V good point about the nav being hidden. For this case the primary nav exists in dom just hidden on small screens
@felixthehat nice! Did not know that about dialogs (if that's the case). I need to start looking at them more seriously, custom modals are not the funnest thing to work with anyway :D