Only trigger re-render on setting valueAsArray if the arrays are actually different

pull/1912/head
Matt Pharoah 2024-03-11 16:31:07 -04:00
rodzic 867428d301
commit 34570d505d
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -93,7 +93,9 @@ export default class SlMultiRange extends ShoelaceElement implements ShoelaceFor
set valueAsArray(value: readonly number[] | null) {
const oldValue = this.#value;
this.#value = value || [];
this.requestUpdate('value', oldValue.join(','));
if (arraysDiffer(oldValue, this.#value)) {
this.requestUpdate('value', oldValue.join(','));
}
}
get valueAsArray() {
return this.#value;