Skip to content

Commit

Permalink
resize in the initial frame
Browse files Browse the repository at this point in the history
  • Loading branch information
mj12albert committed Nov 25, 2024
1 parent 80250c3 commit b152a03
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ const TextareaAutosize = React.forwardRef(function TextareaAutosize(
resizeObserver = new ResizeObserver(() => {
resizeObserver.unobserve(input);
cancelAnimationFrame(frameRef.current);
handleResize();
frameRef.current = requestAnimationFrame(() => {
resizeObserver.observe(input);
handleResize();
});
});
resizeObserver.observe(input);
Expand Down

0 comments on commit b152a03

Please sign in to comment.