Selaa lähdekoodia

fix: buttons jump around on the mobile menu (#5658)

Update MobileMenu.tsx
zsviczian 2 vuotta sitten
vanhempi
commit
cd61f31116
1 muutettua tiedostoa jossa 5 lisäystä ja 6 poistoa
  1. 5 6
      src/components/MobileMenu.tsx

+ 5 - 6
src/components/MobileMenu.tsx

@@ -121,7 +121,6 @@ export const MobileMenu = ({
   const renderAppToolbar = () => {
     // Render eraser conditionally in mobile
     const showEraser =
-      !appState.viewModeEnabled &&
       !appState.editingElement &&
       getSelectedElements(elements, appState).length === 0;
 
@@ -140,11 +139,11 @@ export const MobileMenu = ({
 
         {actionManager.renderAction("undo")}
         {actionManager.renderAction("redo")}
-        {showEraser && actionManager.renderAction("eraser")}
-
-        {actionManager.renderAction(
-          appState.multiElement ? "finalize" : "duplicateSelection",
-        )}
+        {showEraser
+          ? actionManager.renderAction("eraser")
+          : actionManager.renderAction(
+              appState.multiElement ? "finalize" : "duplicateSelection",
+            )}
         {actionManager.renderAction("deleteSelectedElements")}
       </div>
     );