Przeglądaj źródła

add aria-pressed and aria-label to toggle button to make it accessible

Sine Jespersen 8 miesięcy temu
rodzic
commit
0ba84a670d

+ 4 - 0
src/lib/components/workspace/Models/ModelEditor.svelte

@@ -497,6 +497,10 @@
 							<button
 								class="p-1 text-xs flex rounded-sm transition"
 								type="button"
+								aria-pressed={enableDescription ? 'true' : 'false'}
+								aria-label={enableDescription
+									? $i18n.t('Custom description enabled')
+									: $i18n.t('Default description enabled')}
 								on:click={() => {
 									enableDescription = !enableDescription;
 								}}