carbon icon indicating copy to clipboard operation
carbon copied to clipboard

Add error prop to the Search component

Open harsh096 opened this issue 3 years ago • 3 comments

Desired behaviour

We have a requirement to show error on Search component (Image attached) when user tries to search with less than 2 characters.

image

Current behaviour

Seems like there are no error props for Search component as of now like we have for Textbox and Multiselect which lets us add custom error text and also turns border to red color.

Suggested Solution

No response

CodeSandbox or Storybook URL

No response

Anything else we should know?

Desired functionality is implemented already for Textbox and Multiselect components which lets us add custom error text and also turns border to red color.

Confidentiality

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

harsh096 avatar Jun 16 '22 12:06 harsh096

@ljemmo are DS ok with us enabling the textbox error styling on search?

nicktitchmarsh avatar Aug 02 '22 13:08 nicktitchmarsh

@nicktitchmarsh Yes, happy for you to enable this. Can we make sure that the red error border is visible on to the left of the green search button though?

Also, can we make sure this error doesn't appear after 1 key press. Rather it should appear after enter is hit or the green button is selected.

ljemmo avatar Aug 02 '22 16:08 ljemmo

FE-5292

@ljemmo we would supply the props for consuming apps to control. How the validation is triggered is down to implementing teams

nicktitchmarsh avatar Aug 04 '22 12:08 nicktitchmarsh

:tada: This issue has been resolved in version 110.5.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

carbonci avatar Sep 09 '22 09:09 carbonci