You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/10/27 16:02:21 UTC

[GitHub] [incubator-superset] etr2460 commented on a change in pull request #11445: fix: Pasting text issues in MetricsControl and AdhocFilterControl inputs

etr2460 commented on a change in pull request #11445:
URL: https://github.com/apache/incubator-superset/pull/11445#discussion_r512820844



##########
File path: superset-frontend/src/components/Select/OnPasteSelect.jsx
##########
@@ -75,8 +75,8 @@ export default class OnPasteSelect extends React.Component {
   }
 
   render() {
-    const { selectWrap: SelectComponent, ...restProps } = this.props;
-    return <SelectComponent {...restProps} onPaste={this.onPaste} />;
+    const { selectWrap: SelectComponent, onPaste, ...restProps } = this.props;
+    return <SelectComponent {...restProps} onPaste={onPaste || this.onPaste} />;

Review comment:
       why are we keeping around the old `this.onPaste` code? Is that actually used anywhere? Since we're adding an empty function in `AdhocFilterControl`, that will actually override the original behavior, right?

##########
File path: superset-frontend/src/explore/components/controls/AdhocFilterControl.jsx
##########
@@ -275,6 +275,7 @@ export default class AdhocFilterControl extends React.Component {
           clearable
           closeOnSelect
           onChange={this.onChange}
+          onPaste={() => {}}

Review comment:
       Instead of defining this inline, can you define it as a constant NO_OP function above? Better yet, see if we have a NO_OP function exported from a utils file somewhere to use here.
   
   Finally, I think `() => undefined` is prefered to `() => {}` as it doesn't construct an empty object




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org