From 40600b35420e688ee5d5758224717b484ad34f84 Mon Sep 17 00:00:00 2001 From: Yash Kothari Date: Sat, 30 Mar 2019 14:35:56 +0530 Subject: [PATCH] Select the first tab which matches the search query in preferences (#4825) window After every search clear the selection of tabs and select the first tab in the tabsList. Fixes #4824 --- .../java/org/jabref/gui/preferences/PreferencesDialog.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/jabref/gui/preferences/PreferencesDialog.java b/src/main/java/org/jabref/gui/preferences/PreferencesDialog.java index a64fa630780..437d26cbdf1 100644 --- a/src/main/java/org/jabref/gui/preferences/PreferencesDialog.java +++ b/src/main/java/org/jabref/gui/preferences/PreferencesDialog.java @@ -122,6 +122,8 @@ private void construct() { ScrollPane preferencePaneContainer = new ScrollPane(tab.getBuilder()); preferencePaneContainer.getStyleClass().add("preferencePaneContainer"); container.setCenter(preferencePaneContainer); + } else { + container.setCenter(null); } }); tabsList.getSelectionModel().selectFirst(); @@ -136,6 +138,8 @@ private void construct() { tabsList.itemsProperty().bindBidirectional(searchHandler.filteredPreferenceTabsProperty()); searchBox.textProperty().addListener((observable, previousText, newText) -> { searchHandler.filterTabs(newText.toLowerCase(Locale.ROOT)); + tabsList.getSelectionModel().clearSelection(); + tabsList.getSelectionModel().selectFirst(); }); VBox buttonContainer = new VBox();