Skip to content

Commit

Permalink
fix: Remove button is broken for metrics on Explore (apache#22940)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored Feb 1, 2023
1 parent eaf53db commit ebed50f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ class AdhocFilterControl extends React.Component {
sections={this.props.sections}
operators={this.props.operators}
datasource={this.props.datasource}
onRemoveFilter={() => this.onRemoveFilter(index)}
onRemoveFilter={e => {
e.stopPropagation();
this.onRemoveFilter(index);
}}
onMoveLabel={this.moveLabel}
onDropLabel={() => this.props.onChange(this.state.values)}
partitionColumn={this.state.partitionColumn}
Expand Down Expand Up @@ -195,6 +198,7 @@ class AdhocFilterControl extends React.Component {
onRemoveFilter(index) {
const { confirmDeletion } = this.props;
const { values } = this.state;
const { removeFilter } = this;
if (confirmDeletion) {
const { confirmationText, confirmationTitle, triggerCondition } =
confirmDeletion;
Expand All @@ -203,7 +207,7 @@ class AdhocFilterControl extends React.Component {
title: confirmationTitle,
content: confirmationText,
onOk() {
this.removeFilter(index);
removeFilter(index);
},
});
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,7 @@ export const OptionControlLabel = ({
<CloseContainer
role="button"
data-test="remove-control-button"
onClick={e => {
e.stopPropagation();
onRemove();
}}
onClick={onRemove}
>
<Icons.XSmall iconColor={theme.colors.grayscale.light1} />
</CloseContainer>
Expand Down

0 comments on commit ebed50f

Please sign in to comment.