Bug: Form Combo Boxes Cannot Change Parameters During Event

Here is a snippet that reproduces this issue: DHTMLX Snippet Tool

I want to mark the form items that have been modified using CSS.
To do this, I am putting a “is-dirty” class on the items during an on-change event like this:

form.events.on("change", function (name, value) {
    form.getItem(name).setProperties({ css: "is-dirty" });
});

If this is done to a combo box, then it causes lots of internal errors:
image

I think this happens because it wants to show the dropdown list after making a change to the input box.
Here’s a bad way for the user to fix this:

form.events.on("change", function (name, value) {
    const item = form.getItem(name);
    setTimeout(() => {
        item.blur();
        setTimeout(() => {
            item.setProperties({ css: "is-dirty" });
        }, 50);
    }, 50);
});

A better solution would be for the library to (in the functions that could be triggered by a destructor) check the config variable (because the destructor removes it) before using it like this:


I apologize for the delay. Thank you for your report. The problem is confirmed. We’ll try to fix it in future updates.
I’ll inform you about the progress on this issue.

1 Like

Thank you for your report. We have fixed that problem in the latest (7.2.4) dhx.Suite update.

1 Like