michael-s-molina opened a new pull request, #21480: URL: https://github.com/apache/superset/pull/21480
### SUMMARY When `allowNewOptions` was true and the options contained numbers as values, if the user searched for a value that already existed, the options would be duplicated because `hasOption` was not transforming the `string` input before comparing it with the existing values. Given that the possible value types are `string | number | null | undefined`, this PR changes that logic to use the equality operator (not strict) to compare the values. I also changed the `handleOnSearch` to be debounced and improved some Typescript definitions. @cccs-RyanK ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF https://user-images.githubusercontent.com/70410625/190415329-0280fdb5-05db-4b96-9776-a04a5cdbfeb6.mov https://user-images.githubusercontent.com/70410625/190415398-22403e4f-6113-4f5b-a935-120eabf8f2ca.mov ### TESTING INSTRUCTIONS Check the videos for instructions. ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
