jabref
jabref copied to clipboard
Library tab unable to close after unsave action
JabRef version
5.6 (latest release)
Operating system
Windows
Details on version and operating system
No response
Checked with the latest development build
- [X] I made a backup of my libraries before testing the latest development version.
- [X] I have tested the latest development version and the problem persists
Steps to reproduce the behaviour
- Click on "New library" button.
- Click on "+" button to add new article.
- Click on "X" beside tab to close tab.
- Click on "Return to JabRef" or "X" button to close
Save before closingdialog. - Click on "X" beside tab again to close tab.
- User unable to select or close the tab.
https://user-images.githubusercontent.com/49628911/167342107-33fcf7f1-d223-459a-98bb-2993466ede64.mp4
Appendix
...
Log File
Paste an excerpt of your log file here
Mentioned in PR #8297 when I am working on #8296 and #8096. Failed to fix this issue but found the root of this issue.
Issue happens here:
event.consume() only able to trigger once if dialogService is executed in closeTab()
libraryTab.setOnCloseRequest(event -> {
closeTab(libraryTab);
libraryTab.getDataLoadingTask().cancel();
event.consume();
});
Optional<ButtonType> response = dialogService.showCustomButtonDialogAndWait(Alert.AlertType.CONFIRMATION,
Localization.lang("Save before closing"),
Localization.lang("Library '%0' has changed.", filename),
saveChanges, discardChanges, cancel);
More testing:
I have found that showAndWait() is causing event.consume() to only run once.

To clarify: This issue was mentioned in pr #8297, but this can also be reproduced in current JabRef stable 5.6.
It appears to be a known JavaFX issue involving Alert dialogs; it was reported in OpenJFX 11 and ~~fixed~~ targeted to OpenJFX 19 - Alert disables Tab selection when TabDragPolicy REORDER is used
Note
- I changed the drag policy in TabPane to
TabPane.TabDragPolicy.FIXEDand the issue is gone.- I updated JavaFX version to 19-ea+6 but the problem persists.
- I tried this workaround but it doesn't work.
@HoussemNasri Thanks for the hint, it is targeted for javafx19, but there is not, yet, any PR linked to it :( So we have to wait until it gets fixed
it is targeted for javafx19, but there is not, yet, any PR linked to it
Thank you for the clarification, this explains why updating to version 19-ea+6 didn't fix it.
The bug still present in JavaFX 19 release version. It is targeted to be fixed in version 20. A pull request has already been submitted to address it: https://github.com/openjdk/jfx/pull/895
Thank you for reporting this issue. We think, that is already fixed in our development version and consequently the change will be included in the next release.
We would like to ask you to use a development build from https://builds.jabref.org/main and report back if it works for you. Please remember to make a backup of your library before trying-out this version.