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

   <!-- Bito Reply -->
   The flagged issue is correct. The current `hasOption` implementation likely 
only checks top-level options, failing to detect matches within grouped options 
(where options are nested under a `options` array). To resolve this, 
`hasOption` needs to be updated to recursively search through nested `options` 
arrays if they exist.
   
   Would you like me to check the rest of the comments on this PR and implement 
fixes for them as well?
   
   
**superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx**
   ```
   const hasOption = (value: V, options: SelectOptionsType, recursive = false): 
boolean => {
     return options.some(option => {
       if (option.value === value || option.label === value) return true;
       if (recursive && 'options' in option && Array.isArray(option.options)) {
         return hasOption(value, option.options as SelectOptionsType, true);
       }
       return false;
     });
   };
   ```


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