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,10 +66,12 @@ 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 ">
<code className={`inline-block w-full ${commonClassName}`}>
<span <span
style={{ whiteSpace: "break-spaces" }}
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
__html: syntaxHighlight(text, isVisible || isSecretFocused) ?? "" __html: syntaxHighlight(text, isVisible || isSecretFocused) ?? ""
}} }}
@@ -81,7 +83,7 @@ export const SecretInput = forwardRef<HTMLTextAreaElement, Props>(
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()}
@@ -94,6 +96,7 @@ export const SecretInput = forwardRef<HTMLTextAreaElement, Props>(
{...props} {...props}
/> />
</div> </div>
</div>
); );
} }
); );