Selaa lähdekoodia

Fix terminal output disappears after switching tabs (#604)

Paweł Ciosek 1 vuosi sitten
vanhempi
sitoutus
b672ac3632
1 muutettua tiedostoa jossa 9 lisäystä ja 3 poistoa
  1. 9 3
      frontend/src/components/Workspace.tsx

+ 9 - 3
frontend/src/components/Workspace.tsx

@@ -62,9 +62,15 @@ function Workspace() {
           ))}
         </Tabs>
       </div>
-      <div className="h-full w-full p-4 bg-bg-workspace">
-        {tabData[activeTab].component}
-      </div>
+      {Object.keys(tabData).map((tab) => (
+        <div
+          className="h-full w-full p-4 bg-bg-workspace"
+          key={tab}
+          hidden={activeTab !== tab}
+        >
+          {tabData[tab as TabType].component}
+        </div>
+      ))}
     </>
   );
 }