mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-17 03:03:27 -06:00
fix(a11y): a group's checkbox in the member picker has a name and isn't inside the group's button (#33418)
This commit is contained in:
@@ -68,6 +68,16 @@
|
||||
}
|
||||
};
|
||||
|
||||
const toggleGroup = (group: { id: string; [key: string]: any }) => {
|
||||
if ((groupIds ?? []).includes(group.id)) {
|
||||
groupIds = groupIds.filter((id) => id !== group.id);
|
||||
delete selectedGroup[group.id];
|
||||
} else {
|
||||
groupIds = [...groupIds, group.id];
|
||||
selectedGroup[group.id] = group;
|
||||
}
|
||||
};
|
||||
|
||||
let page = 1;
|
||||
let users: any[] | null = null;
|
||||
let total: number | null = null;
|
||||
@@ -242,20 +252,14 @@
|
||||
|
||||
<div class="mb-3">
|
||||
{#each filteredGroups as group, groupIdx (group.id)}
|
||||
<button
|
||||
<div
|
||||
class=" dark:border-gray-850 text-xs flex items-center justify-between w-full"
|
||||
type="button"
|
||||
on:click={() => {
|
||||
if ((groupIds ?? []).includes(group.id)) {
|
||||
groupIds = groupIds.filter((id) => id !== group.id);
|
||||
delete selectedGroup[group.id];
|
||||
} else {
|
||||
groupIds = [...groupIds, group.id];
|
||||
selectedGroup[group.id] = group;
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div class="px-3 py-1.5 font-normal text-gray-900 dark:text-white flex-1">
|
||||
<button
|
||||
type="button"
|
||||
class="px-3 py-1.5 font-normal text-gray-900 dark:text-white flex-1"
|
||||
on:click={() => toggleGroup(group)}
|
||||
>
|
||||
<div class="flex items-center gap-2">
|
||||
<Tooltip content={group.name} placement="top-start">
|
||||
<div class="font-normal truncate flex items-center gap-1">
|
||||
@@ -263,16 +267,18 @@
|
||||
</div>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
|
||||
<div class="px-3 py-1">
|
||||
<div class=" translate-y-0.5">
|
||||
<Checkbox
|
||||
ariaLabel={group.name}
|
||||
on:change={() => toggleGroup(group)}
|
||||
state={(groupIds ?? []).includes(group.id) ? 'checked' : 'unchecked'}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user