evergreen icon indicating copy to clipboard operation
evergreen copied to clipboard

Set Autocomplete input value based on selected item when allowOtherValues is true

Open brandongregoryscott opened this issue 3 years ago • 3 comments

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
Previous Behavior - Item is selected but not updated as input value Current Behavior - Item is selected and input value reflects selection

Documentation

  • [ ] Updated Typescript types and/or component PropTypes
  • [ ] Added / modified component docs
  • [x] Added / modified Storybook stories

brandongregoryscott avatar Aug 03 '22 11:08 brandongregoryscott

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...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Aug 03 '22 11:08 netlify[bot]

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 avatar Aug 05 '22 15:08 rutvij2811

@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!

brandongregoryscott avatar Aug 18 '22 19:08 brandongregoryscott