Skip to content

A platform for community discussion. Free, open, simple.

FIX: correctly render ace editor in FormKit (#28601)

Joffrey JAFFEUX0977f9fb4738
diff --git a/app/assets/stylesheets/common/form-kit/_control-code.scss b/app/assets/stylesheets/common/form-kit/_control-code.scss
index 105d4caa0f5..63b5b2bf4a2 100644
--- a/app/assets/stylesheets/common/form-kit/_control-code.scss
+++ b/app/assets/stylesheets/common/form-kit/_control-code.scss
@@ -1,35 +1,38 @@
-.form-kit__control-code {
- height: 250px;
- width: 100%;
-
- > .ace_editor {
- box-sizing: border-box;
- border: 1px solid var(--primary-400);
- border-radius: var(--d-input-border-radius);
+.form-kit__field-code {
+ .ace-wrapper {
+ width: 100%;
+ > .loading-container {
+ width: 100%;
+ }
}
- &[data-disabled="false"] {
- > .ace_editor {
- @include default-input;
- height: 100% !important;
+ .ace-wrapper[data-disabled="true"] {
+ opacity: 0.5;
- &.ace_focus {
- border-color: var(--tertiary);
- outline: 2px solid var(--tertiary);
- outline-offset: -1px;
- }
+ .ace_scroller {
+ cursor: not-allowed !important;
}
}
- .form-kit__field.has-error & {
- border-color: var(--danger);
+ .ace-wrapper[data-disabled="false"] {
+ .ace_focus {
+ @include default-input;
+ height: unset;
+ border-color: var(--tertiary);
+ outline: 2px solid var(--tertiary);
+ outline-offset: -1px;
+ }
}
+}
- &[data-disabled]:not([data-disabled="false"]) {
- opacity: 0.5;
+.form-kit__control-code {
+ height: 250px !important;
+ width: 100%;
+ box-sizing: border-box;
+ border: 1px solid var(--primary-400);
+ border-radius: var(--d-input-border-radius);
- .ace_scroller {
- cursor: not-allowed !important;
- }
+ .form-kit__field.has-error & {
+ border-color: var(--danger);
}
}