bito-code-review[bot] commented on PR #41074:
URL: https://github.com/apache/superset/pull/41074#issuecomment-4811685479

   <!-- Bito Reply -->
   The flagged issue is correct. When `fetchOnlyOnSearch` is enabled, clearing 
`inputValue` without resetting the options or state causes the component to 
stop fetching (because `allowFetch` becomes false), leaving the dropdown 
populated with stale search results. To resolve this, you should ensure that 
when `autoClearSearchValue` triggers a reset of `inputValue`, it also resets 
the internal options state to match the empty-input behavior expected by 
`fetchOnlyOnSearch`.
   
   Here is a concise fix for 
`superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx`:
   
   ```tsx
         if (autoClearSearchValue) {
           setInputValue('');
           if (fetchOnlyOnSearch) {
             setSelectOptions([]);
           }
         }
   ```
   
   There are no other comments on this PR to address. Would you like me to 
perform any other checks?
   
   
**superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx**
   ```
   if (autoClearSearchValue) {
           setInputValue('');
           if (fetchOnlyOnSearch) {
             setSelectOptions([]);
           }
         }
   ```


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

Reply via email to