From b5a9c396494420f3d763b114f2e576efe870133e Mon Sep 17 00:00:00 2001 From: Kevin Klein Date: Sun, 9 Oct 2022 11:01:47 +0200 Subject: [PATCH 1/2] Fix unexpected closing of preferences dialog --- CHANGELOG.md | 1 + .../org/jabref/gui/preferences/PreferencesDialogView.java | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 895a48815ec..0dbc7b7ee0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue where pdfs were re-indexed on each startup. [#9166](https://github.com/JabRef/jabref/pull/9166) - We fixed an issue where Capitalize didn't capitalize words after hyphen characters. [#9157](https://github.com/JabRef/jabref/issues/9157) - We fixed an issue with the message that is displayed when fetcher returns an empty list of entries for given query. [#9195](https://github.com/JabRef/jabref/issues/9195) +- We fixed an issue where hitting enter on the search field within the preferences dialog closed the dialog. [#630](https://github.com/koppor/jabref/issues/630) ### Removed diff --git a/src/main/java/org/jabref/gui/preferences/PreferencesDialogView.java b/src/main/java/org/jabref/gui/preferences/PreferencesDialogView.java index a4bb0baab0c..b366d81c3db 100644 --- a/src/main/java/org/jabref/gui/preferences/PreferencesDialogView.java +++ b/src/main/java/org/jabref/gui/preferences/PreferencesDialogView.java @@ -6,6 +6,7 @@ import javafx.scene.control.ButtonType; import javafx.scene.control.ListView; import javafx.scene.control.ScrollPane; +import javafx.scene.input.KeyCode; import org.jabref.gui.DialogService; import org.jabref.gui.JabRefFrame; @@ -51,6 +52,13 @@ public PreferencesDialogView(JabRefFrame frame) { ControlHelper.setAction(saveButton, getDialogPane(), event -> savePreferencesAndCloseDialog()); + // Stop the default button from firing when the user hits enter within the search box + searchBox.setOnKeyPressed(event -> { + if (event.getCode() == KeyCode.ENTER) { + event.consume(); + } + }); + themeManager.updateFontStyle(getDialogPane().getScene()); } From 51aeff67142a39f7aa0f5ba235bf014ce5af282e Mon Sep 17 00:00:00 2001 From: Christoph Date: Sun, 9 Oct 2022 22:01:45 +0200 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dbc7b7ee0d..6eb90022e91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,7 +63,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue where pdfs were re-indexed on each startup. [#9166](https://github.com/JabRef/jabref/pull/9166) - We fixed an issue where Capitalize didn't capitalize words after hyphen characters. [#9157](https://github.com/JabRef/jabref/issues/9157) - We fixed an issue with the message that is displayed when fetcher returns an empty list of entries for given query. [#9195](https://github.com/JabRef/jabref/issues/9195) -- We fixed an issue where hitting enter on the search field within the preferences dialog closed the dialog. [#630](https://github.com/koppor/jabref/issues/630) +- We fixed an issue where hitting enter on the search field within the preferences dialog closed the dialog. [koppor#630](https://github.com/koppor/jabref/issues/630) ### Removed