robinparisi / tingle

⚡ 2kB vanilla modal plugin, no dependencies and easy-to-use
https://tingle.robinparisi.com
MIT License
1.55k stars 185 forks source link

Handling of Enter-key #172

Open joho1968 opened 3 years ago

joho1968 commented 3 years ago

To some extent, this is related to #168, but it's not the same.

If I have a list of clickable items that, once clicked, open a Tingle modal, the link is still active (if no other element in the modal receives focus). If I hit the key, the browser's default behaviour is to act on the clickable item again, thus opening another modal (depending on how it's implemented of course).

Using this.blur() in the event handler will, of course, also work. But somehow I think Tingle should handle this better as it's a "modal".