Skip to content

Commit

Permalink
remove handleOnMouseDown function
Browse files Browse the repository at this point in the history
  • Loading branch information
carlinmack committed Apr 18, 2024
1 parent 93c731e commit 12c37c3
Showing 1 changed file with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ export class MultipleOptionsSearchBar extends Component {
this.setState({ queryString: value });
};

handleMouseDown = (e) => {
e.persist();
if(e.target.nodeName === "BUTTON") this.handleOnSearchClick();
}

render() {
const { placeholder, options } = this.props;
const { queryString } = this.state;
Expand All @@ -80,7 +75,7 @@ export class MultipleOptionsSearchBar extends Component {
onResultSelect={this.handleOnResultSelect}
onSearchChange={this.handleOnSearchChange}
resultRenderer={(props) => resultRenderer(props, queryString)}
onMouseDown={this.handleMouseDown} // not onClick as button moves after focus
onMouseDown={this.handleOnSearchClick} // not onClick as button moves after focus
results={options}
value={queryString}
placeholder={placeholder}
Expand Down Expand Up @@ -133,11 +128,6 @@ export class MultipleOptionsSearchBarCmp extends Component {
onInputChange(value);
};

handleMouseDown = (e) => {
e.persist();
if(e.target.nodeName === "BUTTON") this.onBtnSearchClick();
}

render() {
const { placeholder, queryString, options } = this.props;
const button = (
Expand All @@ -158,7 +148,7 @@ export class MultipleOptionsSearchBarCmp extends Component {
onResultSelect={this.onBtnSearchClick}
onSearchChange={this.handleOnSearchChange}
resultRenderer={(props) => resultRenderer(props, queryString)}
onMouseDown={this.handleMouseDown} // not onClick as button moves after focus
onMouseDown={this.handleOnSearchClick} // not onClick as button moves after focus
results={options}
value={queryString}
placeholder={placeholder}
Expand Down

0 comments on commit 12c37c3

Please sign in to comment.