iter(g313): sortableList 禁用态补视觉线索
This commit is contained in:
@@ -46,6 +46,12 @@ export function sortableList(props: SortableListProps): SortableListHandle {
|
||||
...(props.value ? props.value() : props.items).map((text) => rows.get(text)).filter((row): row is HTMLElement => !!row),
|
||||
) as HTMLElement;
|
||||
syncAria();
|
||||
// 禁用态:拖不动就得看得出来——否则用户反复拖拽无反应,以为组件坏了
|
||||
effect(() => {
|
||||
const off = disabled();
|
||||
root.classList.toggle('is-disabled', off);
|
||||
root.setAttribute('aria-disabled', String(off)); // 读屏同样能播报「当前不可调整」
|
||||
});
|
||||
|
||||
// —— 鼠标 / 触摸拖放:dragstart 记源行,dragover 就地搬节点,dragend 落定提交 ——
|
||||
/*** 最近的纵向滚动祖先:拖到边缘要能自动滚,否则长列表根本拖不到视口外 ***/
|
||||
|
||||
Reference in New Issue
Block a user