Skip to content

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

FIX: [rich editor] footnotes editor inside list items (#37343)

Renato Atilio4025dad5da8c
diff --git a/app/assets/stylesheets/common/rich-editor/rich-editor.scss b/app/assets/stylesheets/common/rich-editor/rich-editor.scss
index 90fece64f12..454229b41b0 100644
--- a/app/assets/stylesheets/common/rich-editor/rich-editor.scss
+++ b/app/assets/stylesheets/common/rich-editor/rich-editor.scss
@@ -481,6 +481,10 @@
.ProseMirror {
overflow-wrap: break-word;
white-space: break-spaces;
+
+ // Any children with position fixed will be relative to this element (eg. footnotes)
+ // see https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Display/Containing_block#identifying_the_containing_block
+ contain: layout;
}
// stylelint-disable-next-line no-duplicate-selectors
diff --git a/plugins/footnote/assets/stylesheets/footnotes.scss b/plugins/footnote/assets/stylesheets/footnotes.scss
index 37af189e190..7f941e4329d 100644
--- a/plugins/footnote/assets/stylesheets/footnotes.scss
+++ b/plugins/footnote/assets/stylesheets/footnotes.scss
@@ -82,7 +82,10 @@
.footnote-tooltip {
cursor: auto;
- position: absolute;
+
+ // Position is fixed to be relative to the .ProseMirror editor
+ // See https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Display/Containing_block#identifying_the_containing_block
+ position: fixed;
max-height: 40%;
overflow: auto;
left: 0;