Skip to content

Commit 30c2f75

Browse files
authored
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
1 parent cc0bd39 commit 30c2f75

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ export class UxChipInput implements Themable {
4848
}
4949
}
5050

51+
if (this.value) {
52+
this.chips = this.value.split(this.separator);
53+
}
54+
5155
if (this.disabled || this.disabled === '') {
5256
this.textbox.setAttribute('disabled', '');
5357
this.chiprepeat.removeAttribute('deletable');
@@ -143,7 +147,15 @@ export class UxChipInput implements Themable {
143147
chipValue = null;
144148
}
145149

146-
this.value = chipValue;
150+
if (chipValue !== this.value) {
151+
this.value = chipValue;
152+
}
153+
}
154+
155+
public valueChanged(newValue: string) {
156+
if (newValue && newValue !== this.chips.join(this.separator)) {
157+
this.chips = newValue.split(this.separator);
158+
}
147159
}
148160

149161
public disabledChanged(newValue: any) {

0 commit comments

Comments
 (0)