Skip to content

Fix overflow issues with monaco file editor

What does this MR do?

This MR fixes #229468 (closed) where an outer scroll container is conflicting with Monaco's built in scroll container. This outer scroll container is actually caused by using a <pre> tag for the root element for our editor.

This MR updates all #editor elements to use a <div> with a <pre> child, wrapping it's inner content, so that the preloaded state still looks nice with preformatted text.

Screenshots

Description Before After
Blob edit (with Feature.disable(:monaco_blobs)) 20200727_overflow_before_blob_off 20200727_after_blob_off
Blob edit (with Feature.enable(:monaco_blobs)) 20200727_overflow_before_blob_on 20200727_after_blob_on
Snippets edit (with Feature.disable(:snippets_edit_vue)) snipppets_off_before snippets_off_after
Snippets edit (with Feature.enable(:snippets_edit_vue)) snippets_on_before snippets_on_after
Blob editor loading (shows for a split second) before_-_blob_loading_content after_-_blob_monaco_loading_content
Snippet editor loading (shows for a split second) before_-_snippet_loading_content after_-_snippet_loading_content

Does this MR meet the acceptance criteria?

Conformity

References

Edited by Paul Slaughter

Merge request reports