[Editor] Enable submitting on enter in autocommit Parameters

The bug was related to autocommit IntegerParameter, which did not update the value when user provided value by hand in text field and pressed the enter.
This commit is contained in:
2021-02-18 22:50:32 +01:00
parent 0772984779
commit 9fd172f50a

View File

@@ -21,11 +21,7 @@ abstract class Parameter<T>(
val valueProperty: ObjectProperty<T> = SimpleObjectProperty(initialValue)
var value by valueProperty
fun commit() {
if (!autocommit) {
onCommit(value, editorValueProperty.value, this::submit)
}
}
fun commit() = onCommit(value, editorValueProperty.value, if (autocommit) this::submit else NOOP)
private fun submit() {
value = editorValueProperty.value