@samitouri / QOS-React-2 / commits / 179a7f9605

Fix output tabs growing infinitely in height

The `automaticLayout` config option for Monaco causes it to remeasure itself, and the parent container's height being longer than the screen causes it to constantly grow infinitely. You can observe this bug by going to the playground, expanding any tab, and watch the scrollbar grow as the editor quickly grows to ridiculous heights and your laptop starts glowing red hot and̶͙̕ H̴͉͘e comes t̵͙́o ̴̜̿de̷̼̚s̷̻̍ec̶̮͒rate all knowled̵̥̆ge

Lauren Tan committed Nov 29, 2022 at 11:07 UTC 179a7f96050976ab7b1ea814764e6e5c264fbca3
1 file changed +3 -1
compiler/forget/packages/playground/components/Editor/Output.tsx
+3 -1
@@ -202,7 +202,9 @@ function getSourceMapUrl(code: string, map: string): string | null {
202
203 function TextTabContent({ output }: { output: string }) {
204 return (
205 - <div className="w-full h-full">
205 + // Restrict MonacoEditor's height, since the config autoLayout:true
206 + // will grow the editor to fit within parent element
207 + <div className="w-full h-monaco_small sm:h-monaco">
208 <MonacoEditor
209 defaultLanguage="javascript"
210 value={output}