iter(g258): select 增加可访问名参数

This commit is contained in:
HIsheR
2026-10-26 22:21:04 +08:00
parent 9a1a6f9ed1
commit 3036f26505
6 changed files with 21 additions and 4 deletions
+1
View File
@@ -39,6 +39,7 @@ export function select(props: SelectProps): HTMLElement {
class: `ua-select-trigger${props.size && props.size !== 'md' ? ` is-${props.size}` : ''}`,
'aria-haspopup': 'listbox',
'aria-expanded': () => String(open()),
'aria-label': props.ariaLabel ?? null, // 无可见 label 时由调用方给名字,null 让 h() 不落属性
disabled: props.disabled, // 布尔或信号禁用,h() 直接透传(原生 button 拦截点击)
onClick: () => open(!open()),
},