Skip to content

Commit

Permalink
馃 backported "Hide Popover suggestions on item removal" (#24479)
Browse files Browse the repository at this point in the history
* dont show suggestions on token removal (#24442)

* prettier fix

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
  • Loading branch information
4 people committed Aug 2, 2022
1 parent 5369eec commit 5d16ee4
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions frontend/src/metabase/components/TokenField/TokenField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -459,18 +459,12 @@ export default class TokenField extends Component<
} else {
onChange(valueToAdd.slice(0, 1));
}
// reset the input value
// setTimeout(() =>
// this.setInputValue("")
// )
}

removeValue(valueToRemove: any) {
const { value, onChange } = this.props;
const values = value.filter(v => !this._valueIsEqual(v, valueToRemove));
onChange(values);
// reset the input value
// this.setInputValue("");
}

_valueIsEqual(v1: any, v2: any) {
Expand Down Expand Up @@ -596,6 +590,7 @@ export default class TokenField extends Component<
onClick={e => {
e.preventDefault();
this.removeValue(v);
this.inputRef?.current?.blur();
}}
onMouseDown={e => e.preventDefault()}
>
Expand Down

0 comments on commit 5d16ee4

Please sign in to comment.