From d8bf8f1c024e24562b43617fc2d55fc82b3b607f Mon Sep 17 00:00:00 2001 From: Jim Nielsen Date: Sat, 14 Oct 2023 23:59:04 -0600 Subject: [PATCH] chore: add jsdoc annotations --- src/js/components/Textarea.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/js/components/Textarea.js b/src/js/components/Textarea.js index e49cc1a..59d88df 100644 --- a/src/js/components/Textarea.js +++ b/src/js/components/Textarea.js @@ -1,20 +1,19 @@ import { autosize, html, React } from "../deps.js"; const { useEffect, useRef } = React; +/** @param {any} props */ export default function Textarea(props) { - const { children, ...rest } = props; const ref = useRef(null); useEffect(() => { autosize(ref.current); }, []); + /** @param {KeyboardEvent} e */ + const onKeyDown = (e) => { + autosize(e.target); + }; + return html` - + `; }