-
Notifications
You must be signed in to change notification settings - Fork 166
[terra-form-search-select] Added error message for invalid example #3980
Conversation
@@ -67,6 +67,7 @@ | |||
--terra-form-select-toggle-invalid-box-shadow: 0 0 0 1px #fb4c4c; | |||
--terra-form-select-toggle-invalid-focus-border-color: #004c76; | |||
--terra-form-select-toggle-invalid-focus-box-shadow: 0 0 0 1px #004c76, 0 0 0 1px #004c76; | |||
--terra-form-select-error-text-color: #fb4c4c; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need this variable ..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
}; | ||
|
||
const handleFocus = () => { | ||
setInvalidText('Please select a color'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be default message and you need to clear it onchange !!
isInvalid should be updated back to true when user clears the value from dropdown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not required since we have removed the clear selection prop
<> | ||
<SearchSelect | ||
placeholder="Select a color" | ||
isInvalid={isInvalid} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should also add aria-invalid attribute for search-select-input control whenever isInvalid
is set to true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was already added in some other PR
Summary
Added error message for invalid example and instruction text to test the error message. Previously there is no error message for invalid example. With this change we have added error message and made border color dynamic to check the error state is working correctly or not.
What was changed:
Added error message and instruction text to validate invalid example.
Why it was changed:
Testing
This change was tested using:
Reviews
In addition to engineering reviews, this PR needs:
Additional Details
This PR resolves:
UXPLATFORM-9841
Thank you for contributing to Terra.
@cerner/terra