Skip to content

Commit

Permalink
fix(textarea) do not pass dynamicHeight as DOM attribute to textarea
Browse files Browse the repository at this point in the history
Signed-off-by: lorumic <[email protected]>
  • Loading branch information
lorumic authored and mas-who committed Dec 8, 2023
1 parent d5ddc55 commit 2fac990
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/AutoExpandingTextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ type Props = {
} & TextareaProps;

const AutoExpandingTextArea: FC<Props> = (props) => {
const { dynamicHeight, id, value, rows } = props;
const { dynamicHeight, ...textAreaProps } = props;
const { id, value, rows } = textAreaProps;

useLayoutEffect(() => {
if (dynamicHeight) {
Expand All @@ -23,7 +24,7 @@ const AutoExpandingTextArea: FC<Props> = (props) => {
return (
<div>
<Textarea
{...(props as TextareaProps)}
{...(textAreaProps as TextareaProps)}
rows={dynamicHeight ? undefined : rows}
/>
</div>
Expand Down

0 comments on commit 2fac990

Please sign in to comment.