表单行不再用 label 包 button 型控件
没有 for 的 label 会绑定内部第一个可关联控件。导入 ini 的「内容」行里 那是 DropFile 的按钮:悬停 textarea 会点亮投放区,点到行内空白处直接 弹出文件选择框。SelectBox 的开关按钮同理(InboundForm、RuleGroupForm、 ini 映射行),悬停整行都会点亮它。这些行改用 div,无障碍名换成控件 自己的 aria-label。ComboBox 的行保持 label——它第一个可关联控件是文本 输入框,label 转发过去正是想要的行为。
This commit is contained in:
@@ -111,7 +111,10 @@ function onBackdrop(event: MouseEvent) {
|
||||
</header>
|
||||
|
||||
<div class="body">
|
||||
<label class="row">
|
||||
<!-- 不能用 label 包:没有 for 的 label 绑定内部第一个可关联控件,
|
||||
正好是 DropFile 的按钮——悬停 textarea 会点亮投放区,点到行内
|
||||
空白处还会弹出文件选择框 -->
|
||||
<div class="row">
|
||||
<span class="k">内容</span>
|
||||
<span class="v">
|
||||
<DropFile accept=".ini,.conf,.txt" @load="(_, content) => (text = content)" />
|
||||
@@ -121,9 +124,10 @@ function onBackdrop(event: MouseEvent) {
|
||||
rows="8"
|
||||
placeholder="或把 ini 文本粘贴到这里"
|
||||
spellcheck="false"
|
||||
aria-label="ini 内容"
|
||||
></textarea>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<template v-if="entries.length > 0">
|
||||
<div class="row">
|
||||
@@ -138,12 +142,18 @@ function onBackdrop(event: MouseEvent) {
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<label v-for="target in targets" :key="target" class="row">
|
||||
<!-- 同上:SelectBox 的面板开关也是 button,label 会把悬停和点击都转给它 -->
|
||||
<div v-for="target in targets" :key="target" class="row">
|
||||
<span class="k map-name" :title="target">{{ target }}</span>
|
||||
<span class="v">
|
||||
<SelectBox v-model="mapping[target]" :options="outboundOptions" placeholder="映射到…" />
|
||||
<SelectBox
|
||||
v-model="mapping[target]"
|
||||
:options="outboundOptions"
|
||||
placeholder="映射到…"
|
||||
:aria-label="`${target} 映射到`"
|
||||
/>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user