From c296dd45914b714a08656a8ef0ceed7954c45f81 Mon Sep 17 00:00:00 2001 From: Christian Mortaro Date: Sat, 21 Jan 2023 02:20:21 -0300 Subject: [PATCH 1/3] :bug: fix textarea attributes update --- client/rerender.js | 6 +++--- tests/src/TwoWayBindings.njs | 7 ++++++- tests/src/TwoWayBindings.test.js | 14 ++++++++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/client/rerender.js b/client/rerender.js index e5f03f2e..cb25092c 100644 --- a/client/rerender.js +++ b/client/rerender.js @@ -109,9 +109,9 @@ function _rerender(current, next) { } if (current.type === 'textarea') { - current.value = current.children[0].text - next.value = next.children[0].text - updateAttributes(selector, current, next) + current.attributes.value = current.children[0].text + next.attributes.value = next.children[0].text + updateAttributes(selector, current.attributes, next.attributes) return } diff --git a/tests/src/TwoWayBindings.njs b/tests/src/TwoWayBindings.njs index 8a2b4f38..45a2c7c2 100644 --- a/tests/src/TwoWayBindings.njs +++ b/tests/src/TwoWayBindings.njs @@ -27,6 +27,8 @@ class TwoWayBindings extends Nullstack { debouncedEvent = '69' debounceTime = 1000 + textareaDisabled = false + parse({ event, source: bind, callback }) { const normalized = event.target.value.replace(',', '').padStart(3, '0') const whole = (parseInt(normalized.slice(0, -2)) || 0).toString() @@ -68,10 +70,13 @@ class TwoWayBindings extends Nullstack { {!this.boolean &&
} {this.number > 1 &&
} -