Skip to content

Commit

Permalink
Reuse search handler for mobile and desktop search buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
afwillia committed Feb 5, 2025
1 parent ee4f29b commit 81735b8
Showing 1 changed file with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,10 @@ public SearchViewImpl(
this.dateTimeUtils = dateTimeUtils;
this.markdownIt = markdownIt;
headerWidget.configure();
searchButton.addClickHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
presenter.setSearchTerm(searchField.getText());
}
}
);
searchButtonSmall.addClickHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
presenter.setSearchTerm(searchField.getText());
}
}
);
ClickHandler searchHandler = event ->
presenter.setSearchTerm(searchField.getValue());
searchButton.addClickHandler(searchHandler);
searchButtonSmall.addClickHandler(searchHandler);
searchField.addKeyDownHandler(
new KeyDownHandler() {
@Override
Expand Down

0 comments on commit 81735b8

Please sign in to comment.