Skip to content

Commit

Permalink
feat: textarea
Browse files Browse the repository at this point in the history
  • Loading branch information
sanqi-med committed Jan 25, 2024
1 parent cae5a9e commit 48ae675
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/quarkd/src/textarea/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,14 @@ class TextArea extends QuarkElement {
value = "";

textAreaRef: any = createRef();

componentDidMount() {
requestAnimationFrame(() => {
if (!this.textAreaRef && !this.textAreaRef.current) return;
if (!this.autosize) return;
const { current } = this.textAreaRef;
current.style.height = `${current.scrollHeight}px`;
});
}
evenFn = (type: string) => (e: Event) => {
if (!this.textAreaRef && !this.textAreaRef.current) return;
e.stopPropagation();
Expand Down

0 comments on commit 48ae675

Please sign in to comment.