setIcon() keeps the cssClass of the previous icon

SmartClient Version: v13.1p_2026-10-21/Enterprise Deployment

Hi, please try this test case:

isc.StyleSheetHandler.create({
    autoLoad: true,
    cssText: ".myIcon {color: red;}"
});

isc.IButton.create({
    ID: "testButton",
    title: "foo bar",
    icon: "Edit:cssClass:myIcon"
});

after calling:

testButton.setIcon("Cancel");

the icon changes, but it stays red. It loses the color only after testButton.markForRedraw()

Is markForRedraw() expected to be necessary here?

hi Claudio,

No, you shouldn’t need to redraw, and that’s now been fixed - you can see the fix in the current latest builds at Patch & Development Builds | Isomorphic Software