Skip to content

Does not trigger change event when list option is selected by clicking an option #8

@robinwilson16

Description

@robinwilson16

The script does not trigger a change event if the user selects an option by clicking on it but it does if an option is selected by the keyboard.

I have got it to do this by adding these two lines onto the end of the listSet function:

let changeEvent = new Event(`change`);
dl.input.dispatchEvent(changeEvent);

The reason for this change is so if you have any custom code that triggers when the value changes this will then still work as it did.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions