Преглед изворни кода

Merge pull request #4253 from erickgamer787/fix-SensitiveInput-for-admin-pages

fix: Fix the SensitiveInput  the browser thought it was a password field
Timothy Jaeryang Baek пре 9 месеци
родитељ
комит
ef36b21684
2 измењених фајлова са 6 додато и 2 уклоњено
  1. 4 0
      src/app.css
  2. 2 2
      src/lib/components/common/SensitiveInput.svelte

+ 4 - 0
src/app.css

@@ -154,3 +154,7 @@ input[type='number'] {
 .tippy-box[data-theme~='dark'] {
 	@apply rounded-lg bg-gray-950 text-xs border border-gray-900 shadow-xl;
 }
+
+.password {
+	-webkit-text-security: disc;
+}

+ 2 - 2
src/lib/components/common/SensitiveInput.svelte

@@ -13,13 +13,13 @@
 
 <div class={outerClassName}>
 	<input
-		class={inputClassName}
+		class={`${inputClassName} ${show ? '' : 'password'}`}
 		{placeholder}
 		bind:value
 		required={required && !readOnly}
 		disabled={readOnly}
 		autocomplete="off"
-		{...{ type: show ? 'text' : 'password' }}
+		type="text"
 	/>
 	<button
 		class={showButtonClassName}