Hacker News new | ask | show | jobs
by Sateeshm 559 days ago
Normal close in most examples not working for me. Android Firefox
3 comments

For me it's the autofocus property on the close button that didn't work yesterday when I was using this in a project. Ended up adding a line to whenever I call show() like $('#thatModal *[autofocus]').focus()

MDN says this should work as intended out of the box

Could you elaborate on what you mean by "normal close in most examples"? All the examples I see come with a JS snippet to add an event listener to the close button and those work for me in Firefox for Android.
As the MDN article documents, you don't necessarily have to use JavaScript:

```HTML <form method="dialog"> <button>Close</button> </form> ```

Same here. Chrome, Windows 10.

Only the listeners added via JS seem to work correctly.