From 4f877400c57953feefb4ea77adc14c35ede5613b Mon Sep 17 00:00:00 2001 From: Loay Ghreeb <52158423+LoayGhreeb@users.noreply.github.com> Date: Tue, 30 Apr 2024 09:05:56 +0300 Subject: [PATCH] Update search results when active database changes (#11268) Merged origin/update-search-results into update-search-results --- src/main/java/org/jabref/gui/search/GlobalSearchBar.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/search/GlobalSearchBar.java b/src/main/java/org/jabref/gui/search/GlobalSearchBar.java index de9319c93a3..5c18e02243a 100644 --- a/src/main/java/org/jabref/gui/search/GlobalSearchBar.java +++ b/src/main/java/org/jabref/gui/search/GlobalSearchBar.java @@ -238,7 +238,7 @@ public GlobalSearchBar(LibraryTabContainer tabContainer, query -> setSearchTerm(query.map(SearchQuery::getQuery).orElse(""))); this.searchQueryProperty.addListener((obs, oldValue, newValue) -> newValue.ifPresent(this::updateSearchResultsForQuery)); - this.searchQueryProperty.addListener((obs, oldValue, newValue) -> searchQueryProperty.get().ifPresent(this::updateSearchResultsForQuery)); + this.stateManager.activeDatabaseProperty().addListener(obs -> searchQueryProperty.get().ifPresent(this::updateSearchResultsForQuery)); /* * The listener tracks a change on the focus property value. * This happens, from active (user types a query) to inactive / focus