Respond to wj-combo-change on ui selection only

Posted by: seaninglis on 20 August 2022, 8:16 pm EST

    • Post Options:
    • Link

    Posted 20 August 2022, 8:16 pm EST

    I need to handles the selectedIndexChanged event, but only in response to a user selecting an entry from the dropdown, not in response to making changes to itemsSource.

    How can I reliably tell in my event handler that the change was prompted in response to user interaction and not automatically?

    I’ve tried examining the isDroppedDown property in the selectedIndexChanged event handler, but this always set to false.

    Do I need to set a flag on the drop down event and track it in some way?

  • Posted 21 August 2022, 10:37 pm EST

    Hello,

    Yes, you can check whether the event is raised by user selection or not by setting the flag in the isDroppedDownChanged event. Please refer to the sample link below for the same:

    https://stackblitz.com/edit/angular-fuhfz9?file=src%2Fapp%2Fapp.component.ts

    Regards

  • Posted 24 August 2022, 10:00 am EST

    Thanks sonu, I used a very similar method in the end, all working as expected

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels