Set Autocomplete input value based on selected item when allowOtherValues is true
Overview
Resolves #1496
This is a small change to update the inputValue state to the selected item when allowOtherValues is set. This issue was only noticeable in uncontrolled instances of the Autocomplete, i.e. one that does not set the selectedItem prop (Default Example on our doc site). The correct value (i.e. the selected item) was being set internally, but the input field was not reflecting it.
I added some tests to cover this behavior as well. React testing library was updated to get rid of some warnings about the v18 createRoot API.
Screenshots (if applicable)
| Previous | Current |
|
|
Documentation
- [ ] Updated Typescript types and/or component PropTypes
- [ ] Added / modified component docs
- [x] Added / modified Storybook stories
Deploy Preview for evergreen-storybook ready!
| Name | Link |
|---|---|
| Latest commit | d8ccae765d7e67f50c00081d98ce2d9dcbe49c64 |
| Latest deploy log | https://app.netlify.com/sites/evergreen-storybook/deploys/63359531c6c3550008c2e529 |
| Deploy Preview | https://deploy-preview-1506--evergreen-storybook.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
Hey @brandongregoryscott , I also thought of a similar solution to this issue but I seem to fail to build the package. Did you face any similar issues? I am very new to open source contribution and could not find any FAQ of sorts to check if it is an existing issue. Could you guide me or point out some existing resources if any? Thanks in advance.
@rutvij2811 Please open up a new issue if you're having trouble running the project. Any output from the build, and version numbers of the tools in your environment would help. Thanks!