Permalink
Browse files

fix(chip-input): add value changed back

add value changed back. this was removed in an earlier hotfix, this implementation performs more checks to prevent an endless loop
  • Loading branch information...
ZHollingshead committed Apr 18, 2017
1 parent cc0bd39 commit 30c2f75dfee193b7704eb4d43ebd88fee1a362ad
Showing with 13 additions and 1 deletion.
  1. +13 −1 src/chip-input/ux-chip-input.ts
@@ -48,6 +48,10 @@ export class UxChipInput implements Themable {
}
}
+ if (this.value) {
+ this.chips = this.value.split(this.separator);
+ }
+
if (this.disabled || this.disabled === '') {
this.textbox.setAttribute('disabled', '');
this.chiprepeat.removeAttribute('deletable');
@@ -143,7 +147,15 @@ export class UxChipInput implements Themable {
chipValue = null;
}
- this.value = chipValue;
+ if (chipValue !== this.value) {
+ this.value = chipValue;
+ }
+ }
+
+ public valueChanged(newValue: string) {
+ if (newValue && newValue !== this.chips.join(this.separator)) {
+ this.chips = newValue.split(this.separator);
+ }
}
public disabledChanged(newValue: any) {

0 comments on commit 30c2f75

Please sign in to comment.