fix: trimming

This commit is contained in:
nafees nazik
2023-09-20 17:05:57 +05:30
committed by Akhil Mohan
parent 3be3867579
commit ef7bf09398
@@ -56,12 +56,12 @@ export const SecretInput = forwardRef<HTMLTextAreaElement, Props>(
const update = (code: string) => { const update = (code: string) => {
setText(code); setText(code);
if (onChange) { if (onChange) {
onChange(code); onChange(code.trim());
} }
}; };
const onInput = (event: any) => { const onInput = (event: any) => {
const code = event.target.value.trim() || ""; const code = event.target.value || "";
update(code); update(code);
}; };
@@ -80,7 +80,7 @@ export const SecretInput = forwardRef<HTMLTextAreaElement, Props>(
<textarea <textarea
aria-label="secret value" aria-label="secret value"
ref={ref} ref={ref}
className={`textarea absolute inset-0 h-full overflow-hidden block focus:border-0 resize-none bg-transparent text-transparent ${commonClassName}`} className={`textarea absolute inset-0 block h-full resize-none overflow-hidden bg-transparent text-transparent focus:border-0 ${commonClassName}`}
value={text} value={text}
onChange={onInput} onChange={onInput}
onFocus={() => setIsSecretFocused.on()} onFocus={() => setIsSecretFocused.on()}