Closed dianasanborn closed 3 years ago
@tw15egan @laurenmrice I'd like to take a stab at this enhancement if nobody else is already on it!
Would this also require a new optional
prop? I don't currently see any existing functionality in the docs to make this component optional
@AlexanderLyon Awesome! I'll let @laurenmrice chime in with design / UX specs for you to follow.
I'm thinking we'd want this functionality to be tied to a new prop. Based on our WIP naming conventions for our next major release, I think this new prop would make sense as isOptional
.
@joshblack What do you think?
I opened a PR in the meantime with one possible solution for this, but I'd love some feedback if there's some more detailed specs to be followed!
We are going to use Dianas UX approach. (this has been tested with user research)
Here is the spec below @AlexanderLyon :
@joshblack created a Codesandbox that demonstrates that we can achieve this implementation with our current codebase. A prop won't be needed.
Summary
There is a need for users to have a way to clear the selection for optional dropdowns.
For example: If a user made a selection on an optional field, but wanted to remove the selection and keep it blank.
We are looking to include a "Select" option in the dropdown to allow the user to revert back to a null option, but would love the Carbon team's thoughts on this as well.
It would be helpful if this guidance was also included in the dropdown component as well.