ADDITIONAL SYSTEM INFORMATION :
JavaFX 23-ea+3. Java; openjdk version "22.0.1" 2024-04-16; Ubuntu 20.04.3 LTS
A DESCRIPTION OF THE PROBLEM :
When a value from editable comboBox is added to comboBox items then editor value changes.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the provided code. After that enter in ComboBox field "test" and click the button.
More info:
https://stackoverflow.com/questions/78511921/adding-to-combobox-items-list-a-text-from-editor-changes-editor-text-in-javafx
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
After clicking the button editor value musn't change.
ACTUAL -
After clicking the button editor value changes.
---------- BEGIN SOURCE ----------
public class JavaFxTest7 extends Application {
@Override
public void start(Stage stage) {
var list = List.of("A", "B", "C");
var comboBox = new ComboBox<String>();
comboBox.setEditable(true);
comboBox.setItems(FXCollections.observableArrayList(list));
var button = new Button("Push Me");
button.setOnAction(e -> {
comboBox.getItems().add(0, comboBox.getValue());
});
Scene scene = new Scene(new VBox(comboBox, button), 400, 200);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch();
}
}
---------- END SOURCE ----------
FREQUENCY : always
JavaFX 23-ea+3. Java; openjdk version "22.0.1" 2024-04-16; Ubuntu 20.04.3 LTS
A DESCRIPTION OF THE PROBLEM :
When a value from editable comboBox is added to comboBox items then editor value changes.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the provided code. After that enter in ComboBox field "test" and click the button.
More info:
https://stackoverflow.com/questions/78511921/adding-to-combobox-items-list-a-text-from-editor-changes-editor-text-in-javafx
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
After clicking the button editor value musn't change.
ACTUAL -
After clicking the button editor value changes.
---------- BEGIN SOURCE ----------
public class JavaFxTest7 extends Application {
@Override
public void start(Stage stage) {
var list = List.of("A", "B", "C");
var comboBox = new ComboBox<String>();
comboBox.setEditable(true);
comboBox.setItems(FXCollections.observableArrayList(list));
var button = new Button("Push Me");
button.setOnAction(e -> {
comboBox.getItems().add(0, comboBox.getValue());
});
Scene scene = new Scene(new VBox(comboBox, button), 400, 200);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch();
}
}
---------- END SOURCE ----------
FREQUENCY : always
- links to
-
Commit(master) openjdk/jfx/5cdbae24
-
Review(master) openjdk/jfx/1692