I noticed an issue with the disabled state handling in RichTextEditor and RichTextItem.
When I set:
disabled: true
on either RichTextEditor or RichTextItem, the editArea inside RichTextEditor is not affected.
In particular, the disabled state CSS styles are not applied to the editArea, and visually the editor still looks enabled.
I expected that setting disabled=true on the component would propagate the disabled state to the internal editing area and apply the corresponding CSS styles.
Currently, I implemented a workaround that manually applies the required styles/state changes to the editArea, but I suspect there may be a more appropriate built-in way to handle this.
My workaround is the following:
Could you please advise whether this is expected behavior, or if there is a recommended way to correctly disable the RichTextEditor editing area and make it use the standard disabled styling?
When I set:
disabled: true
on either RichTextEditor or RichTextItem, the editArea inside RichTextEditor is not affected.
In particular, the disabled state CSS styles are not applied to the editArea, and visually the editor still looks enabled.
I expected that setting disabled=true on the component would propagate the disabled state to the internal editing area and apply the corresponding CSS styles.
Currently, I implemented a workaround that manually applies the required styles/state changes to the editArea, but I suspect there may be a more appropriate built-in way to handle this.
My workaround is the following:
Code:
isc.RichTextEditor.addProperties({
init: function () {
this.Super("init", arguments);
const editArea = this.editArea;
if (editArea) {
editArea.showDisabled = this.showDisabled;
editArea.baseStyle = editArea.styleName;
editArea.setDisabled = function (disabled) {
this.Super("setDisabled", arguments);
if (this.showDisabled) {
this.setStyleName((this.baseStyle + (disabled ? "Disabled" : "")));
}
};
}
},
setDisabled: function (disabled) {
this.Super("setDisabled", arguments);
this.editArea?.setDisabled(disabled);
},
});
isc.RichTextItem.addProperties({
init: function () {
this.canvasProperties = { ...this.canvasProperties, showDisabled: this.showDisabled, disabled: this.disabled }
this.Super("init", arguments);
},
setDisabled: function (disabled) {
this.Super("setDisabled", arguments);
this.canvas?.setDisabled(disabled);
},