Skip to content

Commit 275996e

Browse files
committed
perf: typography shaking when edit
1 parent a61ec0a commit 275996e

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

components/input/ResizableTextArea.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { CSSProperties, VNode } from 'vue';
22
import {
3+
onMounted,
34
getCurrentInstance,
45
watch,
56
onBeforeUnmount,
@@ -142,6 +143,11 @@ const ResizableTextArea = defineComponent({
142143
});
143144
},
144145
);
146+
onMounted(() => {
147+
nextTick(() => {
148+
resizeTextarea();
149+
});
150+
});
145151
const instance = getCurrentInstance();
146152
expose({
147153
resizeTextarea,

components/input/inputProps.ts

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export interface ShowCountProps {
8585
}
8686
const textAreaProps = {
8787
...omit(inputProps, ['prefix', 'addonBefore', 'addonAfter', 'suffix']),
88+
rows: Number,
8889
autosize: { type: [Boolean, Object] as PropType<AutoSizeType>, default: undefined },
8990
autoSize: { type: [Boolean, Object] as PropType<AutoSizeType>, default: undefined },
9091
onResize: { type: Function as PropType<(size: { width: number; height: number }) => void> },

components/typography/Editable.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ const Editable = defineComponent({
122122
onCompositionstart={onCompositionStart}
123123
onCompositionend={onCompositionEnd}
124124
onBlur={onBlur}
125+
rows={1}
125126
autoSize={props.autoSize === undefined || props.autoSize}
126127
/>
127128
{slots.enterIcon ? (

0 commit comments

Comments
 (0)