Skip to content

Commit

Permalink
allow item renderer to work better with component thats value are obj…
Browse files Browse the repository at this point in the history
…ects
  • Loading branch information
ianharrigan committed Sep 17, 2024
1 parent 25a4834 commit 793bc4e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion haxe/ui/core/ItemRenderer.hx
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,17 @@ class ItemRenderer extends Box {
if (itemIndex < 0) {
return;
}

var v = event.target.value;
if (_data != null && event.target.id != null) {
var item:Dynamic = Reflect.getProperty(_data, event.target.id);
switch (Type.typeof(item)) {
case TObject:
item.value = v;
if (Type.typeof(v) != TObject) {
item.value = v;
} else {
Reflect.setProperty(_data, event.target.id, v);
}
case _:
Reflect.setProperty(_data, event.target.id, v);
}
Expand Down

0 comments on commit 793bc4e

Please sign in to comment.