mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-19 02:12:10 +08:00
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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
5d7dc3aed9
commit
1638ab48d8
@@ -4,6 +4,7 @@
|
||||
<summary><strong> 🐞 修复问题 </strong></summary>
|
||||
|
||||
- 修复「代理集合」「规则集合」订阅响应较慢时更新误报失败、且不显示真实失败原因的问题
|
||||
- 修复读屏软件将普通模式下的侧边栏导航项播报为不可用的可拖拽控件的问题
|
||||
|
||||
**🖥️ Windows**
|
||||
|
||||
|
||||
@@ -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 (
|
||||
<LayoutItem key={item.path} to={item.path} icon={item.icon}>
|
||||
{t(item.label)}
|
||||
</LayoutItem>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<SortableItem
|
||||
key={item.path}
|
||||
id={item.path}
|
||||
index={index}
|
||||
disabled={!menuUnlocked}
|
||||
>
|
||||
<SortableItem key={item.path} id={item.path} index={index}>
|
||||
{(sortable) => (
|
||||
<LayoutItem to={item.path} icon={item.icon} sortable={sortable}>
|
||||
{t(item.label)}
|
||||
|
||||
Reference in New Issue
Block a user