https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • i

    icy-zebra-52882

    03/17/2023, 11:08 AM
    I'd have thought that setting the property itself would be enough to trigger the onChange, even if the value is the same
  • b

    bright-gpu-74537

    03/17/2023, 11:12 AM
    yeah, im not saying its not a bug, just that my guess is thats whats happening... lots of times behaviours wont run if they underlying value is the same (which is intentional)
  • b

    bright-gpu-74537

    03/17/2023, 11:13 AM
    but there can be edge cases, like for example here, if the data source is changed, i would think it should be like "nothing is selected", even if the selectedIndex is 0
  • i

    icy-zebra-52882

    03/17/2023, 11:14 AM
    hmm I'm trying to make it select the first entry though, not make it "nothing is selected", to cut down on manual clicks and changes the user has to do
  • i

    icy-zebra-52882

    03/17/2023, 11:15 AM
    so that when you change the NPC, it automatically goes onto first entry of theirs
  • b

    bright-gpu-74537

    03/17/2023, 11:15 AM
    no i mean internally, not you... i think what is likely to be happening is: you have a data source, and the selected index is 0... then you change the data source, but the selected index is still zero so no event is raised
  • i

    icy-zebra-52882

    03/17/2023, 11:16 AM
    oh ignore me then, I misunderstood
  • i

    icy-zebra-52882

    03/17/2023, 11:16 AM
    lemme throw together a quick test
  • b

    bright-gpu-74537

    03/17/2023, 11:18 AM
    http://haxeui.org/builder/?431b19e6
  • b

    bright-gpu-74537

    03/17/2023, 11:19 AM
    similar thing on all backends by the look of it... actually worse on composites as it doesnt even change the text
  • b

    bright-gpu-74537

    03/17/2023, 11:21 AM
    heres a cheap fix until i get round to fixing it, dont know if it will work on native though (should do): http://haxeui.org/builder/?ea936fc7
  • b

    bright-gpu-74537

    03/17/2023, 11:21 AM
    TL;DR:
    Copy code
    haxe
    var ds = ArrayDataSource.fromArray([
        "Item " + Std.random(0xff),
        "Item " + Std.random(0xff),
        "Item " + Std.random(0xff),
        "Item " + Std.random(0xff),
        "Item " + Std.random(0xff)
    ]);
    dd.selectedIndex = -1;
    dd.dataSource = ds;
    dd.selectedIndex = 0;
  • i

    icy-zebra-52882

    03/17/2023, 11:31 AM
    setting to -1 beforehand doesn't change whether onChange for dropdown is triggered
  • i

    icy-zebra-52882

    03/17/2023, 11:31 AM
    at least on hxwidgets
  • b

    bright-gpu-74537

    03/17/2023, 11:32 AM
    right, fair enough... well, ill take a look at it when i fix composites too
  • i

    icy-zebra-52882

    03/17/2023, 11:35 AM
    https://github.com/Bloodninj/hxui-dropdown-selectedIndex here's a repro
  • b

    bright-gpu-74537

    03/17/2023, 11:37 AM
    thanks!
  • h

    happy-agent-4114

    03/17/2023, 6:45 PM
    this means I'm using @:bind wrong somewhere right
  • h

    happy-agent-4114

    03/17/2023, 6:45 PM
    I can't find anything that doesn't work in that class
  • b

    bright-gpu-74537

    03/17/2023, 6:47 PM
    code?
  • b

    bright-gpu-74537

    03/17/2023, 6:49 PM
    http://haxeui.org/builder/?f3f9411c
  • h

    happy-agent-4114

    03/17/2023, 6:51 PM
    I might have found the issue hold on a sec
  • h

    happy-agent-4114

    03/17/2023, 6:54 PM
    http://haxeui.org/builder/?f3f9411c broken for other reasons now
  • h

    happy-agent-4114

    03/17/2023, 6:57 PM
    pasted the wrong link here's real one http://haxeui.org/builder/?a158e564
  • h

    happy-agent-4114

    03/17/2023, 7:04 PM
    it's a ton of code but I have no idea which of my bind events it breaks in
  • b

    bright-gpu-74537

    03/17/2023, 7:25 PM
    ... sorry, where is the bind? And i hope you arent expecting this to work on native too... 🙂
  • h

    happy-agent-4114

    03/17/2023, 7:25 PM
    def not, it's html5 only
  • h

    happy-agent-4114

    03/17/2023, 7:25 PM
    I don't know which bind event is broken, the error only tells me it's somewhere in main
  • h

    happy-agent-4114

    03/17/2023, 7:26 PM
    all of them are () -> Void but it doesn't work for some reason
  • b

    bright-gpu-74537

    03/17/2023, 7:26 PM
    OK, but where is the bind? I dont see any events here
1...160016011602...1687Latest