Code Editor enable/disable does not work

Using 2.2.3, I have a screen with Code Editor and button to start editing the file.
in beforeShow I set enabled(false) on the code editor.
When I press the button I do setEnabled(true) on code editor.
Expected behaviour I can edit the code after having pressed the button, actual behaviour I can move in the code but code is not editable.
If I do not “play” with setEnabled() on the code and leave it enabled I can change the content.

I also have weird behaviour when I press the cancel butorn, I try to restore the initial value of the code(messageBox, are you sure… if yes, I use setValue() ). In that case the value is not reset on the component.

Hi!

This is a bug, I created a task to solve it: CodeEditor can't be enabled if it was disabled before · Issue #3488 · jmix-framework/jmix · GitHub.
The fix will be published in release 2.3.2.

For now I can suggest the following workarounds:

  1. Use the readOnly property instead of enabled
  2. After setting enabled to true call the following code
    codeEditor.setEnabled(true);
    // text area activation
    codeEditor.getElement().executeJs(
        "$0._editor.textInput.getElement().removeAttribute('disabled');"
    );
    

Best regards,
Dmitriy

Thanks a lot for the fast turn around and the work around!