fix(a11y): the Visibility button's name includes the choice it shows (#33125)

This commit is contained in:
G30 2026-10-24 23:15:42 -04:00 • committed by GitHub
parent 331b38f875
commit 5372577430
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -503,7 +503,6 @@
<Dropdown closeOnSelect>
<button
type="button"
aria-label={labels.title ?? $i18n.t('Visibility')}
class="flex h-6 items-center gap-2 rounded-md text-[0.8125rem] font-medium text-gray-800 transition hover:text-gray-950 dark:text-gray-200 dark:hover:text-white"
>
{#if visibility === 'private'}
@ -511,6 +510,7 @@
{:else}
<GlobeAlt className="size-3.5 text-gray-500 dark:text-gray-400" />
{/if}
<span class="sr-only">{labels.title ?? $i18n.t('Visibility')}</span>
<span>{visibilityOptions.find((option) => option.value === visibility)?.label}</span>
<ChevronDown className="size-3 text-gray-400 dark:text-gray-500" strokeWidth="2" />
</button>

View file

@ -22,7 +22,6 @@
<Dropdown closeOnSelect>
<button
type="button"
aria-label={$i18n.t('Visibility')}
class="flex h-6 items-center gap-2 rounded-md text-[0.8125rem] font-medium text-gray-800 transition hover:text-gray-950 dark:text-gray-200 dark:hover:text-white"
>
{#if state === 'private'}
@ -30,6 +29,7 @@
{:else}
<Hashtag className="size-3.5 text-gray-500 dark:text-gray-400" />
{/if}
<span class="sr-only">{$i18n.t('Visibility')}</span>
<span>{state === 'private' ? $i18n.t('Private') : $i18n.t('Public')}</span>
<ChevronDown className="size-3 text-gray-400 dark:text-gray-500" strokeWidth="2" />
</button>