Skip to content

Mirror vanilla html input of type checkbox behaviour for submitting forms #1894

@buhodev

Description

@buhodev

when a vanilla html input tag of type="checkbox" is used in a form, you can check/uncheck it with space if it's focused, but it also allows you to press "Enter" to submit the form (similar to what happens if you press "Enter" while a input of type text is focused).

However, the source code of the checkbox component has this line:

if (e.key === kbd.ENTER) e.preventDefault();

Is there a reason why preventing the default behaviour of the checkbox input?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions