Skip to content

File Input - programmatic focus #7665

@gusch

Description

@gusch

Description

We are now using the error summary concept everywhere.
On submit, if there is an error, we display the error on the input and a summary at the top of the form which takes the focus.
The link in the summary has href="id of my input" and will focus on the input using the anchor mechanism.

With FileInput component, the problem is that the input is hidden.
So when we click on the link, nothing visually happen.

Suggested solution

Add the possibility to set an id on "select file" and "clear" buttons.

Image Image

Should the buttons read the name of the input and error message when focused with VoiceOver ?

Demo URL

https://stackblitz.com/edit/parsium-carbon-starter-faedh3y5?file=src%2FApp.tsx

Alternatives

No response

Additional context

No response

Confidentiality

  • I confirm there is no confidential or commercially sensitive information included.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions