mirror of
https://github.com/open-webui/open-webui
synced 2025-06-23 02:16:52 +00:00
Merge pull request #15009 from itk-dev/feature/password-button-accessibility-again
Feat: password button accessibility again
This commit is contained in:
commit
5d90e31ab6
@ -73,7 +73,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<SensitiveInput
|
<SensitiveInput
|
||||||
inputClassName=" outline-hidden bg-transparent w-full"
|
inputClassName="bg-transparent w-full"
|
||||||
placeholder={$i18n.t('API Key')}
|
placeholder={$i18n.t('API Key')}
|
||||||
bind:value={key}
|
bind:value={key}
|
||||||
/>
|
/>
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
const i18n = getContext('i18n');
|
||||||
|
import { getContext } from 'svelte';
|
||||||
|
import { settings } from '$lib/stores';
|
||||||
export let value: string = '';
|
export let value: string = '';
|
||||||
export let placeholder = '';
|
export let placeholder = '';
|
||||||
export let required = true;
|
export let required = true;
|
||||||
@ -12,9 +15,11 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class={outerClassName}>
|
<div class={outerClassName}>
|
||||||
|
<label class="sr-only" for="password-input">{placeholder || $i18n.t('Password')}</label>
|
||||||
<input
|
<input
|
||||||
class={`${inputClassName} ${show ? '' : 'password'}`}
|
class={`${inputClassName} ${show ? '' : 'password'} ${($settings?.highContrastMode ?? false) ? '' : ' outline-hidden'}`}
|
||||||
{placeholder}
|
{placeholder}
|
||||||
|
id="password-input"
|
||||||
bind:value
|
bind:value
|
||||||
required={required && !readOnly}
|
required={required && !readOnly}
|
||||||
disabled={readOnly}
|
disabled={readOnly}
|
||||||
@ -24,6 +29,8 @@
|
|||||||
<button
|
<button
|
||||||
class={showButtonClassName}
|
class={showButtonClassName}
|
||||||
type="button"
|
type="button"
|
||||||
|
aria-pressed={show}
|
||||||
|
aria-label={$i18n.t('Make password visible in the user interface')}
|
||||||
on:click={(e) => {
|
on:click={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
show = !show;
|
show = !show;
|
||||||
@ -34,6 +41,7 @@
|
|||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
viewBox="0 0 16 16"
|
viewBox="0 0 16 16"
|
||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
|
aria-hidden="true"
|
||||||
class="size-4"
|
class="size-4"
|
||||||
>
|
>
|
||||||
<path
|
<path
|
||||||
@ -51,6 +59,7 @@
|
|||||||
viewBox="0 0 16 16"
|
viewBox="0 0 16 16"
|
||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
class="size-4"
|
class="size-4"
|
||||||
|
aria-hidden="true"
|
||||||
>
|
>
|
||||||
<path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z" />
|
<path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z" />
|
||||||
<path
|
<path
|
||||||
|
Loading…
Reference in New Issue
Block a user