michael-s-molina commented on a change in pull request #19076:
URL: https://github.com/apache/superset/pull/19076#discussion_r827007787



##########
File path: superset-frontend/src/components/Select/utils.ts
##########
@@ -61,7 +61,7 @@ export function findValue<OptionType extends OptionTypeBase>(
 }
 
 export function getValue(option: string | number | { value: string | number }) 
{
-  return typeof option === 'object' ? option.value : option;
+  return option && typeof option === 'object' ? option.value : option;

Review comment:
       @diegomedina248 This is happening because the `SelectFilterPlugin` is 
configured incorrectly. By default, if `options` is a function (async) then 
`labelInValue` is `true` otherwise is `false`. The `SelectFilterPlugin` is 
passing a static array of options in the form of `{ label: <label>, value: 
<value> }` but it's not setting the `labelInValue` to `true`. If you set it to 
`true`, you will receive the object in the change event. Please make sure to 
review other parts of the code after changing the `labelInValue` property (like 
`value`).




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