Skip to content

Commit 1441d0d

Browse files
committed
refac
1 parent e5dbfc4 commit 1441d0d

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/lib/components/common/SensitiveInput.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@
1111
export let outerClassName = 'flex flex-1 bg-transparent';
1212
export let inputClassName = 'w-full text-sm py-0.5 bg-transparent';
1313
export let showButtonClassName = 'pl-1.5 transition bg-transparent';
14+
export let screenReader = true;
1415
1516
let show = false;
1617
</script>
1718

1819
<div class={outerClassName}>
19-
<label class="sr-only" for={id}>{placeholder || $i18n.t('Password')}</label>
20+
{#if screenReader}
21+
<label class="sr-only" for={id}>{placeholder || $i18n.t('Password')}</label>
22+
{/if}
2023
<input
2124
{id}
2225
class={`${inputClassName} ${show ? '' : 'password'} ${($settings?.highContrastMode ?? false) ? 'placeholder:text-gray-700 dark:placeholder:text-gray-100' : ' outline-hidden placeholder:text-gray-300 dark:placeholder:text-gray-600'}`}

src/routes/auth/+page.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@
342342
placeholder={$i18n.t('Enter Your Password')}
343343
autocomplete={mode === 'signup' ? 'new-password' : 'current-password'}
344344
name="password"
345+
screenReader={false}
345346
required
346347
/>
347348
</div>

0 commit comments

Comments
 (0)