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:
Zhongheng Liu 2026-01-22 21:42:59 +01:00
commit ad199ea244

View file

@ -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();
});