fix: scroll

This commit is contained in:
nafees nazik
2023-09-20 17:05:57 +05:30
committed by Akhil Mohan
parent 63e8ecce5b
commit f84235eea3
@@ -66,33 +66,36 @@ export const SecretInput = forwardRef<HTMLTextAreaElement, Props>(
}; };
return ( return (
<div className="relative"> <div className="overflow-auto" style={{ maxHeight: `${21 * 7}px` }}>
<pre aria-hidden className="m-0 " style={{ whiteSpace: "break-spaces" }}> <div className="relative overflow-hidden">
<code className={`code inline-block w-full ${commonClassName}`}> <pre aria-hidden className="m-0 ">
<span <code className={`inline-block w-full ${commonClassName}`}>
dangerouslySetInnerHTML={{ <span
__html: syntaxHighlight(text, isVisible || isSecretFocused) ?? "" style={{ whiteSpace: "break-spaces" }}
}} dangerouslySetInnerHTML={{
/> __html: syntaxHighlight(text, isVisible || isSecretFocused) ?? ""
</code> }}
</pre> />
</code>
</pre>
<textarea <textarea
style={{ whiteSpace: "break-spaces" }} style={{ whiteSpace: "break-spaces" }}
aria-label="secret value" aria-label="secret value"
ref={ref} ref={ref}
className={`textarea absolute inset-0 block h-full resize-none overflow-hidden bg-transparent text-transparent focus:border-0 ${commonClassName}`} className={`absolute inset-0 block h-full resize-none overflow-hidden bg-transparent text-transparent no-scrollbar focus:border-0 ${commonClassName}`}
value={text} value={text}
onChange={onInput} onChange={onInput}
onFocus={() => setIsSecretFocused.on()} onFocus={() => setIsSecretFocused.on()}
disabled={isDisabled} disabled={isDisabled}
spellCheck={false} spellCheck={false}
onBlur={() => { onBlur={() => {
if (onBlur) onBlur(); if (onBlur) onBlur();
setIsSecretFocused.off(); setIsSecretFocused.off();
}} }}
{...props} {...props}
/> />
</div>
</div> </div>
); );
} }