openstate / jodal

Open gov data platform for journalists: all government data — monitor, filter, forward. (FKA jodal)
https://bron.live
6 stars 1 forks source link

Form submits on pressing Enter key #129

Closed vanderburgt closed 9 months ago

vanderburgt commented 9 months ago

Describe the bug

Summary Form submits on pressing Enter key while cursor is in search input field

URL / Environment https://bron.live

Steps to reproduce**

  1. Go to bron.live
  2. Type 'rentmeester' in search input field
  3. Press enter to submit form
  4. See error: Email missing ('Melding. Er is geen valide e-mail adres ingevuld. Probeer het opnieuw.')

Expected behavior

Pressing enter does not submit the 'Create alert' form. Instead, the 'Create alert' form is submitted by clicking the 'Create alert' button.

Screenshots

Image

Additional context

Even though the search results refresh each time the content of the input field changes, many users will expect they need to press enter to submit the form. This may confuse them. Suggested solution is therefore to only submit the 'Create alert' form on clicking the 'Create alert' button.