From 1638ab48d8b86e19063c4de49276ada008720bff Mon Sep 17 00:00:00 2001 From: mrhard9090 <74858909+mrhard9090@users.noreply.github.com> Date: Sun, 27 Sep 2026 12:37:54 +0000 Subject: [PATCH] fix(layout): don't expose locked sidebar items as draggables (#8064) While the menu order is locked, the sidebar items were still registered as disabled sortables, so dnd-kit gave each nav button a draggable role description, aria-disabled=true, aria-pressed and the drag instructions. Screen readers announced every item as an unavailable draggable toggle. Only wrap the items in SortableItem while reordering is unlocked. Co-authored-by: Claude Opus 5.5 --- Changelog.md | 1 + src/components/layout/layout-sidebar.tsx | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Changelog.md b/Changelog.md index c5786a35f..15bf1dc5c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,7 @@ 🐞 修复问题 - 修复「代理集合」「规则集合」订阅响应较慢时更新误报失败、且不显示真实失败原因的问题 +- 修复读屏软件将普通模式下的侧边栏导航项播报为不可用的可拖拽控件的问题 **🖥️ Windows** diff --git a/src/components/layout/layout-sidebar.tsx b/src/components/layout/layout-sidebar.tsx index e01734dca..f1a2be2f2 100644 --- a/src/components/layout/layout-sidebar.tsx +++ b/src/components/layout/layout-sidebar.tsx @@ -100,13 +100,18 @@ export const LayoutSidebar = (props: LayoutSidebarProps) => { const item = navItemMap.get(path) if (!item) return null + // A registered sortable, even a disabled one, gets the drag-and-drop ARIA + // attributes, so screen readers announce every item as a disabled draggable. + if (!menuUnlocked) { + return ( + + {t(item.label)} + + ) + } + return ( - + {(sortable) => ( {t(item.label)}