Merge branch 'feature/client-search-fix' into 'main'
fix: Search bar immediately clears search params and returns server contents after ESCAPE key-press See merge request cse1105/2025-2026/teams/csep-team-76!87
This commit is contained in:
commit
ad199ea244
1 changed files with 6 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ import javafx.animation.PauseTransition;
|
|||
import javafx.concurrent.Task;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.input.KeyCode;
|
||||
import javafx.util.Duration;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -146,6 +147,11 @@ public class SearchBarCtrl implements LocaleAware {
|
|||
});
|
||||
|
||||
this.searchField.setOnKeyReleased(event -> {
|
||||
if (event.getCode() == KeyCode.ESCAPE) {
|
||||
searchField.clear();
|
||||
this.onSearch();
|
||||
return;
|
||||
}
|
||||
// This cancels the current debounce timer and restarts it.
|
||||
this.searchDebounce.playFromStart();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue