bugfix: better diff'ing for complex components
This commit is contained in:
parent
dc88eeaae3
commit
ec4a413a7b
2 changed files with 6 additions and 5 deletions
|
|
@ -59,7 +59,7 @@ proc update(current, next: VComponent) =
|
|||
let next = TextInput(next)
|
||||
current.value = next.value
|
||||
current.guid = next.guid
|
||||
next.isActive = current.isActive
|
||||
#next.isActive = current.isActive
|
||||
|
||||
proc newTextInput*(style: VStyle = VStyle(); guid: cstring; value: cstring = cstring"",
|
||||
onchange: proc(v: cstring) = nil): TextInput =
|
||||
|
|
@ -107,10 +107,12 @@ var
|
|||
proc renderPerson(text: cstring, index: int): VNode =
|
||||
proc select(ev: Event, n: VNode) =
|
||||
selected = index
|
||||
errmsg = ""
|
||||
|
||||
result = buildHtml():
|
||||
tdiv(onClick=select):
|
||||
tdiv:
|
||||
text text
|
||||
button(onClick = select)
|
||||
|
||||
proc createDom(): VNode =
|
||||
result = buildHtml(tdiv):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue