Forum Replies Created

  • Thank you Mike!

    I knew my code wouldn’t be easily testable and I apologize for that. I was hoping someone would just provide their own experience and give me a hint to figure it out and you did.

    When you said you never de-select I thought that might be doing it and it was at least partly.

    Setting this doesn’t work as you might expect:
    midi_smith.noteLengthDD.selection = null;

    It did de-select but I think it messed up the internal object structure of the dropdown. So I removed this and only changed the selection never nulled it out.

    Which just means I had to add some extra error checking. What I also found was disabling options that were already disabled seemed to mess it up as well. I thought if I got the current selection index, I could enable/disable all the options (including enabling ones that were already enabled, etc) and then loop through all the options and if the currently selected index was now disabled, select the closest enabled option. Which meant re-selecting the same option if it wasn’t disabled.

    This just seemed to mess stuff up. When I added the error checking to only disable/enable options that weren’t already in that state, and only change the selection if current selection was disabled, it’s working fine now.

    But just the hint of not de-selecting only changing the selection gave me the hint I needed ????

    Thanks!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy