Skip to content

[Bug]: Pressing "Enter" in the username input doesn't submit the search #74

@DamienSable

Description

@DamienSable

Describe the bug
Hey! I was testing out the landing page. After typing my GitHub username into the main input field, I hit the Enter key out of habit to generate the badge, but nothing happens. I have to physically use my mouse to click the "Generate" button.

Expected behavior
Hitting the Enter key while focused on the input field should trigger the search/routing, just like a standard form.

Possible Solution
Taking a quick look at the code, it seems the <input> and <button> are just sitting inside a <div>. If we wrap them in a standard HTML <form> tag and change the button type to submit, the browser will handle the Enter key native behavior automatically.

Let me know if you'd like me to open a PR for this!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions