villebro commented on a change in pull request #14788:
URL: https://github.com/apache/superset/pull/14788#discussion_r638566674
##########
File path:
superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx
##########
@@ -154,67 +160,44 @@ export default function PluginFilterSelect(props:
PluginFilterSelectProps) {
}
};
- useEffect(() => {
- const firstItem: SelectValue = data[0]
- ? (groupby.map(col => data[0][col]) as string[])
- : null;
- if (!isDisabled && defaultToFirstItem && firstItem) {
- // initialize to first value if set to default to first item
- setValues(firstItem);
- } else if (!isDisabled && defaultValue?.length) {
- // initialize to saved value
- setValues(defaultValue);
- }
- }, [defaultToFirstItem, defaultValue]);
-
Review comment:
This `useEffect` has been combined with the other one that was checking
for changes in controls (e.g. inverse selection etc). Now there are only two
`useEffects` left - one to check for changes in data mask, and another to check
for changes in control values.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]