Skip to content

Native form validation does not open <details> #1377

@stephenrwicks

Description

@stephenrwicks

Native form validation will block form submission if there are invalid inputs inside <details> (e.g., blank "required" textbox).

But this will not automatically open <details> and display a validation message. Chrome, Edge, and Firefox all log an error to the console (input is not focusable) and display the next validation error if there is one.

It seems to me the <details> should automatically open, display a validation error, and focus the input. Clicking an anchor tag pointing to the input's ID inside the <details> opens it and focuses the input. Ctrl + F can even open the <details> element automatically.

Basic example: https://codepen.io/stephenrwicks/pen/ZYOdLxb

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions