Skip to content

Commit 0aeba74

Browse files
authored
fix(chips): correctly delete single chip in input
when deleting the last chip in an input, the value would get set to '' which would get inserted as a blank chip. now changes value to null instead
1 parent d2ebeb5 commit 0aeba74

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/chip-input/ux-chip-input.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,13 @@ export class UxChipInput implements Themable {
157157
seperator = this.separator;
158158
}
159159

160-
this.chips = this.value.split(seperator);
160+
let newValue: string | null = this.chips.join(seperator);
161+
162+
if (newValue === '') {
163+
newValue = null;
164+
}
165+
166+
this.value = newValue;
161167
}
162168

163169
public disabledChanged(newValue: any) {

0 commit comments

Comments
 (0)