Skip to content

Commit ac8c477

Browse files
committed
CSSTUDIO-2572 When clicking away without first pressing enter, restore the current value of 'jumpToLogEntryTextField'.
1 parent 73c1567 commit ac8c477

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui/LogEntryDisplayController.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,17 @@ public void initialize() {
117117
}
118118

119119
jumpToLogEntryTextField.setPromptText("Log Entry ID");
120+
jumpToLogEntryTextField.focusedProperty().addListener((property, oldValue, newValue) -> {
121+
if (oldValue && !newValue) {
122+
// When clicking away without first pressing enter, restore the current value of jumpToLogEntryTextField:
123+
if (logEntryProperty.get() != null) {
124+
jumpToLogEntryTextField.setText(logEntryProperty.get().getId().toString());
125+
}
126+
else {
127+
jumpToLogEntryTextField.setText("");
128+
}
129+
}
130+
});
120131
}
121132

122133
@FXML

0 commit comments

Comments
 (0)