File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,11 +47,17 @@ const classes = cva({
4747const textarea = useTemplateRef (' textarea' );
4848
4949onMounted (() => {
50- autosize (textarea .value );
51- setTimeout (() => nextTick (() => autosize .update (textarea .value )), 1 );
50+ if (props .elastic ) {
51+ autosize (textarea .value );
52+ setTimeout (() => nextTick (() => autosize .update (textarea .value )), 1 );
53+ }
5254});
5355
54- onBeforeUnmount (() => autosize .destroy (textarea .value ));
56+ onBeforeUnmount (() => {
57+ if (props .elastic ) {
58+ autosize .destroy (textarea .value );
59+ }
60+ });
5561 </script >
5662
5763<template >
Original file line number Diff line number Diff line change @@ -108,9 +108,9 @@ export const _Placeholder: Story = {
108108} ;
109109
110110const resizeCode = `
111+ <Textarea resize="horizontal" rows="1" placeholder="Resize horizontal"/>
111112<Textarea resize="vertical" rows="1" placeholder="Resize vertical"/>
112113<Textarea resize="both" rows="1" placeholder="Resize both"/>
113- <Textarea resize="horizontal" rows="1" placeholder="Resize horizontal"/>
114114<Textarea resize="none" rows="1" placeholder="Resize none"/>
115115` ;
116116
You can’t perform that action at this time.
0 commit comments