Skip to content

Commit 917dd2e

Browse files
committed
fix: restore presentation value on exception case
Close #45
1 parent 24f6e80 commit 917dd2e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/com/flowingcode/vaadin/addons/chipfield/ChipField.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,13 @@ private void configure() {
157157
() -> {
158158
if (isAllowAdditionalItems()) {
159159
if (newItemHandler == null) {
160+
setPresentationValue(getValue());
160161
throw new IllegalStateException(
161162
"You need to setup a NewItemHandler");
162163
}
163164
return this.newItemHandler.apply(chipLabel);
164165
} else {
166+
setPresentationValue(getValue());
165167
throw new IllegalStateException(
166168
"Adding new items is not allowed, but still receiving new items (not present in DataProvider) from client-side. Probably wrong configuration.");
167169
}

0 commit comments

Comments
 (0)