Jelajahi Sumber

Fix: UI bug

iaun 3 bulan lalu
induk
melakukan
36bd701f20
2 mengubah file dengan 22 tambahan dan 0 penghapusan
  1. 9 0
      frontend/src/components/Layout.jsx
  2. 13 0
      frontend/src/index.css

+ 9 - 0
frontend/src/components/Layout.jsx

@@ -92,6 +92,15 @@ function Layout() {
     navigate('/login')
   }
 
+  // Get the base path for menu selection (handles sub-routes like /persons/new)
+  const getSelectedKey = () => {
+    const path = location.pathname
+    const menuKey = menuItems.find(item => 
+      path === item.key || path.startsWith(item.key + '/')
+    )?.key
+    return menuKey ? [menuKey] : [path]
+  }
+
   const toggleDrawer = () => {
     setDrawerVisible(!drawerVisible)
   }

+ 13 - 0
frontend/src/index.css

@@ -148,3 +148,16 @@ body {
 @media (min-width: 992px) {
   /* Default styles apply */
 }
+
+/* Disable menu selection transition to prevent flicker */
+.ant-menu-item {
+  transition: none !important;
+}
+
+.ant-menu-item-selected {
+  transition: none !important;
+}
+
+.ant-menu-item::after {
+  transition: none !important;
+}