diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/LazyComboBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/LazyComboBox.java index 36b8eb2c1..61df2c9c6 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/LazyComboBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/LazyComboBox.java @@ -55,15 +55,19 @@ public abstract class LazyComboBox extends UIComboBox implements PopupMenuListen @Override public void setSelectedItem(Object anObject) { + initialSelected = anObject; if (loaded) { super.setSelectedItem(anObject); } else { - if (initialSelected == null) { - this.setModel(new DefaultComboBoxModel<>(new Object[]{anObject})); - } + this.setModel(new DefaultComboBoxModel<>(new Object[]{anObject})); super.setSelectedItem(anObject); } + + } + + private void setSelectedItemWithDocumentChange(Object anObject) { initialSelected = anObject; + super.setSelectedItem(anObject); } @Override @@ -185,7 +189,7 @@ public abstract class LazyComboBox extends UIComboBox implements PopupMenuListen } filtering = true; String xx = textField.getText(); - LazyComboBox.this.setSelectedItem(xx); + LazyComboBox.this.setSelectedItemWithDocumentChange(xx); this.item = textField.getText(); setPopupVisible(true);