Skip to content

TextInput should accept a Vue component as an error #196

@davinotdavid

Description

@davinotdavid

Is your feature request related to a problem? Please describe.
Currently, the error prop is a string which limits us on what we can show. For example, if we need an error that is a more complex component with a <router-link /> in it, it is currently not possible to do so.

I believe this will be a common-ish use-case so we should be able to accept a component and inject it as is for better flexibility.

Also, I can't externally manipulate the invalid prop either so if I want to show a custom component as an error somewhere else (like a notice-bar, for example) and still mark the input as invalid, it can't be done as of now.

Describe the solution you'd like
It would be nice to be able to pass in a custom component to the error prop so that we can show the proper input error styles and be more flexible on its usage.

Describe alternatives you've considered
Rendering a component elsewhere and manipulating the invalid prop. This is not currently possible but even if it was it would be quite hacky IMHO since one would need to externally manipulate the style of the error to look like the standard TextInput.

Additional context
Related PR thunderbird/thunderbird-accounts#435

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions