Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close/remove button is broken for metrics on chart page #22898

Closed
3 tasks done
marshallbrekka opened this issue Jan 28, 2023 · 4 comments · Fixed by #22940
Closed
3 tasks done

Close/remove button is broken for metrics on chart page #22898

marshallbrekka opened this issue Jan 28, 2023 · 4 comments · Fixed by #22940
Assignees
Labels
#bug Bug report

Comments

@marshallbrekka
Copy link

marshallbrekka commented Jan 28, 2023

The click handler for the button to remove a metric on the chart page is throwing an exception, breaking the ability to remove metrics from a chart.

Uncaught TypeError: Cannot read properties of undefined (reading 'stopPropagation')
    at yt.onRemoveMetric (AdhocMetricOption.jsx:51:7)
    at onClick (index.tsx:313:11)
    at Object.l (react-dom.production.min.js:14:84)
    at p (react-dom.production.min.js:14:238)
    at react-dom.production.min.js:14:292
    at b (react-dom.production.min.js:15:72)
    at ot (react-dom.production.min.js:52:146)
    at rt (react-dom.production.min.js:51:255)
    at it (react-dom.production.min.js:52:334)
    at ft (react-dom.production.min.js:56:10)

How to reproduce the bug

  1. Go to any chart editing page
  2. Click on the "x" on the left side of a metric that is already added to the chart
  3. Check the browsers dev tools/console for the exception

Expected results

Metric should be removed from the list

Actual results

The metric remains on the chart

Screenshots

Screen Shot 2023-01-28 at 11 31 10 AM

Screen Shot 2023-01-28 at 11 38 12 AM

Environment

(please complete the following information):

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

The onRemoveMetric handler expects to be passed the event object
I believe this is the PR that introduced the bug, as it changed how the onRemove handler is invoked, no-longer passing the event object

@marshallbrekka marshallbrekka added the #bug Bug report label Jan 28, 2023
@rusackas
Copy link
Member

Thanks for the report! Pinging @michael-s-molina in regards to his linked PR, and also pinging @kgabryje as a person who often deals with this sort of control input issue, for good measure. Hopefully, we can not just fix this, but also add some tests here to harden this.

@idkm
Copy link

idkm commented Jan 31, 2023

Hello Team,
I have the same error, can you tell me when to expect a fix?

@michael-s-molina
Copy link
Member

Thanks for reporting this @marshallbrekka. I linked a PR to fix this bug.

@idkm
Copy link

idkm commented Feb 1, 2023

Thank you Team, now it works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants