Re:Interaction without JavaScript: common UI elements with a...
by Lerc on Sunday May 22, 2016 @05:51PM
(#11750445)
In essence the modals are bound to the state of a checkbox. For this technique to work with escape The question thus becomes "Can you uncheck a checkbox with escape, without JavaScript"
It's not a completely unreasonable thing to ask for.
Seems you can get close with the accesskey attribute
It's not very standardized though, you need qualifiers and escape on its own doesn't seem to be available,
I don't know how it interacts with display:none .Ideally accesskey does not apply to display:none items so you could accesskey the same key for many modal close buttons and only have the visible one activate.
It's not a completely unreasonable thing to ask for.
Seems you can get close with the accesskey attribute
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_att...
<input type="checkbox" accesskey="q">
It's not very standardized though, you need qualifiers and escape on its own doesn't seem to be available,
I don't know how it interacts with display:none .Ideally accesskey does not apply to display:none items so you could accesskey the same key for many modal close buttons and only have the visible one activate.