Skip to content

Commit

Permalink
Merge branch 'main' into fix-10120
Browse files Browse the repository at this point in the history
  • Loading branch information
damgam0288 authored Nov 30, 2024
2 parents 87cc072 + 37593bf commit 80cdf05
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed an issue where trying to open a library from a failed mounted directory on Mac would cause an error. [#10548](https://github.com/JabRef/jabref/issues/10548)
- We fixed an issue when the preview was out of sync. [#9172](https://github.com/JabRef/jabref/issues/9172)
- We fixed an issue where identifier paste couldn't work with Unicode REPLACEMENT CHARACTER. [#11986](https://github.com/JabRef/jabref/issues/11986)
- We fixed an issue when click on entry at "Check Integrity" wasn't properly focusing the entry and field. [#11997](https://github.com/JabRef/jabref/issues/11997)

### Removed

Expand Down
21 changes: 19 additions & 2 deletions src/main/java/org/jabref/gui/entryeditor/EntryEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.SortedSet;
import java.util.stream.Collectors;

import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.geometry.Side;
import javafx.scene.control.Button;
Expand Down Expand Up @@ -61,6 +62,7 @@
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.BibEntryTypesManager;
import org.jabref.model.entry.EntryConverter;
import org.jabref.model.entry.field.Field;
import org.jabref.model.util.DirectoryMonitorManager;
import org.jabref.model.util.FileUpdateMonitor;
Expand Down Expand Up @@ -463,11 +465,26 @@ private void fetchAndMerge(EntryBasedFetcher fetcher) {

public void setFocusToField(Field field) {
UiTaskExecutor.runInJavaFXThread(() -> {
Field actualField = field;
boolean fieldFound = false;
for (Tab tab : tabbed.getTabs()) {
tabbed.getSelectionModel().select(tab);
if ((tab instanceof FieldsEditorTab fieldsEditorTab)
&& fieldsEditorTab.getShownFields().contains(field)) {
&& fieldsEditorTab.getShownFields().contains(actualField)) {
tabbed.getSelectionModel().select(tab);
fieldsEditorTab.requestFocus(field);
Platform.runLater(() -> {
fieldsEditorTab.requestFocus(actualField);
});
// This line explicitly brings focus back to the main window containing the Entry Editor.
getScene().getWindow().requestFocus();
fieldFound = true;
break;
}
}
if (!fieldFound) {
Field aliasField = EntryConverter.FIELD_ALIASES.get(field);
if (aliasField != null) {
setFocusToField(aliasField);
}
}
});
Expand Down

0 comments on commit 80cdf05

Please sign in to comment.