Skip to content

Commit

Permalink
Only set value on free text fields
Browse files Browse the repository at this point in the history
I can not see a way to reproduce this thing in the tests.
We would need a way to test components in integration for this.
Two controllers get in each other's way here.
Fixes #2616
  • Loading branch information
1-alex98 committed Mar 17, 2022
1 parent 4fe83fd commit d3e1330
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ private void addInvalidationListener(LogicalNodeController logicalNodeController
logicalNodeController.specificationController.propertyField.valueProperty().addListener(queryInvalidationListener);
logicalNodeController.specificationController.operationField.valueProperty().addListener(queryInvalidationListener);
logicalNodeController.specificationController.valueField.valueProperty().addListener(queryInvalidationListener);
selectValueBeforeLoosingFocusOnValueField(logicalNodeController);
selectValueBeforeLosingFocusOnValueField(logicalNodeController);
logicalNodeController.specificationController.valueField.setOnKeyReleased(event -> {
if (event.getCode() == KeyCode.ENTER) {
searchButton.fire();
}
});
}

private void selectValueBeforeLoosingFocusOnValueField(LogicalNodeController logicalNodeController) {
private void selectValueBeforeLosingFocusOnValueField(LogicalNodeController logicalNodeController) {
logicalNodeController.specificationController.valueField.getEditor().textProperty().addListener(observable -> {
boolean isFreeTextField = !logicalNodeController.specificationController.valueField.valueProperty().isBound()
&& logicalNodeController.specificationController.valueField.getItems().isEmpty();
Expand Down

0 comments on commit d3e1330

Please sign in to comment.