Skip to content

Commit

Permalink
Add reactivity to the textarea kind VNodes. (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
moigagoo authored Dec 28, 2023
1 parent 012d20f commit 8e75d73
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions karax/karax.nim
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,10 @@ proc diff(newNode, oldNode: VNode; parent, current: Node; kxi: KaraxInstance) =
let checked = newNode.getAttr("checked")
oldNode.dom.checked = if checked.isNil: false else: true

# Set the value of the textarea field to update
if oldNode.kind == VNodeKind.textarea:
oldNode.dom.value = newNode.text

if newNode.events.len != 0 or oldNode.events.len != 0:
mergeEvents(newNode, oldNode, kxi)

Expand Down

0 comments on commit 8e75d73

Please sign in to comment.