KendoSwitch causing 2 events 2 events to fire on change

0 Answers 19 Views
Switch
Peter
Top achievements
Rank 1
Peter asked on 27 Feb 2024, 06:50 PM

We are testing 2023.3.1114.   I checked the release notes of 2024.1 and didn't see anything.   We are using LitElement to make a custom control that creates the kendoSwitch as show below.   Not sure what is triggering the 2nd event.   Although, I think 

    initWidget() {
        const selector = '#' + this.elemId;
        const chkMsg = (typeof this.checkedMsg === 'string') ? this.checkedMsg : 'yes';
        const unchkMsg = (typeof this.uncheckedMsg === 'string') ? this.uncheckedMsg : 'no';
        const options = {
            checked: this.isChecked,
            enabled: this.isEnabled,
            messages: {
                checked: chkMsg,
                unchecked: unchkMsg,
            },
            change: (e) => {
                this.updateValue(e.checked);
            }
        };
        $(selector).kendoSwitch(options);
    }

    updateValue(newValue) {
        // fire a change event to the element
        $(this).trigger(CHANGE, [newValue]);
        this.textValue = String(newValue);
        this.requestUpdate();
    }

Neli
Telerik team
commented on 01 Mar 2024, 09:40 AM

Hi Peter,

It is hard to suggest what is the cause for the observed issue without being able to replicate it locally. I tried to reproduce the issue in the Dojo linked here but to no avail. May I ask you to try to isolate the issue in a small runnable example and send it back? This way we could take a closer look and provide further assistance.

Regards,

Neli

No answers yet. Maybe you can help?

Tags
Switch
Asked by
Peter
Top achievements
Rank 1
Share this question
or