Permalink
Browse files

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
  • Loading branch information...
ZHollingshead committed Apr 10, 2017
1 parent d2ebeb5 commit 0aeba7446386cd4bc8abf2172b6552b4afdb6548
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/chip-input/ux-chip-input.ts
@@ -157,7 +157,13 @@ export class UxChipInput implements Themable {
seperator = this.separator;
}
- this.chips = this.value.split(seperator);
+ let newValue: string | null = this.chips.join(seperator);
+
+ if (newValue === '') {
+ newValue = null;
+ }
+
+ this.value = newValue;
}
public disabledChanged(newValue: any) {

0 comments on commit 0aeba74

Please sign in to comment.