fix: add aria-pressed and aria-label to Web Search and Image Generation toggles (#25258)
This commit is contained in:
1 file changed
+4
@@ -269,6 +269,8 @@
|
|||||||
<Tooltip content={$i18n.t('Search the internet')} placement="top-start">
|
<Tooltip content={$i18n.t('Search the internet')} placement="top-start">
|
||||||
<button
|
<button
|
||||||
class="flex w-full justify-between gap-2 items-center px-3 py-1.5 text-sm cursor-pointer rounded-xl hover:bg-gray-50 dark:hover:bg-gray-800/50"
|
class="flex w-full justify-between gap-2 items-center px-3 py-1.5 text-sm cursor-pointer rounded-xl hover:bg-gray-50 dark:hover:bg-gray-800/50"
|
||||||
|
aria-pressed={webSearchEnabled}
|
||||||
|
aria-label={webSearchEnabled ? $i18n.t('Disable Web Search') : $i18n.t('Enable Web Search')}
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
webSearchEnabled = !webSearchEnabled;
|
webSearchEnabled = !webSearchEnabled;
|
||||||
}}
|
}}
|
||||||
@@ -300,6 +302,8 @@
|
|||||||
<Tooltip content={$i18n.t('Generate an image')} placement="top-start">
|
<Tooltip content={$i18n.t('Generate an image')} placement="top-start">
|
||||||
<button
|
<button
|
||||||
class="flex w-full justify-between gap-2 items-center px-3 py-1.5 text-sm cursor-pointer rounded-xl hover:bg-gray-50 dark:hover:bg-gray-800/50"
|
class="flex w-full justify-between gap-2 items-center px-3 py-1.5 text-sm cursor-pointer rounded-xl hover:bg-gray-50 dark:hover:bg-gray-800/50"
|
||||||
|
aria-pressed={imageGenerationEnabled}
|
||||||
|
aria-label={imageGenerationEnabled ? $i18n.t('Disable Image Generation') : $i18n.t('Enable Image Generation')}
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
imageGenerationEnabled = !imageGenerationEnabled;
|
imageGenerationEnabled = !imageGenerationEnabled;
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in new issue
Block a user