ktmud commented on a change in pull request #13221:
URL: https://github.com/apache/superset/pull/13221#discussion_r579570782
##########
File path: superset-frontend/src/explore/components/controls/TextControl.tsx
##########
@@ -102,26 +86,26 @@ export default class TextControl extends React.Component<
parsedValue = parseInt(inputValue, 10);
}
}
- this.props.onChange?.(parsedValue, errors);
+ this.props.onChange?.(parsedValue as T, errors);
};
- onChangeWrapper = (event: any) => {
- const { value } = event.target;
- this.setState({ value });
+ debouncedOnChange = debounce((inputValue: string) => {
+ this.onChange(inputValue);
+ }, FAST_DEBOUNCE);
- // use debounce when change takes effect immediately after user starts
typing
- const onChange = this.props.renderTrigger
- ? this.debouncedOnChange
- : this.onChange;
- onChange(value);
+ onChangeWrapper: FormControlProps['onChange'] = event => {
+ const { value } = event.target as HTMLInputElement;
+ this.setState({ value }, () => {
+ this.debouncedOnChange(value);
+ });
Review comment:
Did more refactoring based on:
https://github.com/apache/superset/pull/13211#issuecomment-782418459
##########
File path:
superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl.jsx
##########
@@ -270,7 +262,7 @@ class AdhocFilterControl extends React.Component {
optionsForSelect(props) {
const options = [
...props.columns,
- ...[...(props.formData.metrics || []), props.formData.metric].map(
+ ...[...(props.selectedMetrics || [])].map(
Review comment:
This is used for allowing selecting adhoc metrics in adhoc filters, but
it has stopping working:
https://github.com/apache/superset/issues/13249
The new `selectedMetrics` will be added by a `superset-ui` PR.
----------------------------------------------------------------
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]