Jen-Harris / Tentacular

Search for Github repos!
https://tentacular.herokuapp.com/
0 stars 1 forks source link

eventListener on click rather than submit #25

Closed ZooeyMiller closed 7 years ago

ZooeyMiller commented 7 years ago

The event listener for when you make the request to your back end is attached to the button on click, if you changed this to wrap the input, button etc in a form and ran the event on submit then hitting enter when in the box would also run the eventListener, it's a bit more semantic and also makes it easier for keyboard users.

Jen-Harris commented 7 years ago

Hey Zooey, thanks for the feedback. I don't think we fully understand! It seems that it already works when using enter without changing anything?

ZooeyMiller commented 7 years ago

So if I use tab to select the button then pressing enter will work, but if you make it all into a form, and then attach the eventListener to the form, with a trigger of "submit" then I can press enter when I've still got focus on the input and it will work.

morkeltry commented 7 years ago

tick :)