Skip to content

Commit 7d7f0f3

Browse files
committed
feat: input & textarea support lazy dir #4951
close #4951
1 parent 6c28a8e commit 7d7f0f3

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

components/input/Input.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ export default defineComponent({
172172
handleInputBlur,
173173
size,
174174
disabled,
175+
valueModifiers = {},
175176
$attrs,
176177
} = this;
177-
178178
const inputProps: any = {
179179
...otherProps,
180180
...$attrs,
@@ -190,6 +190,9 @@ export default defineComponent({
190190
onFocus: handleInputFocus,
191191
onBlur: handleInputBlur,
192192
};
193+
if (valueModifiers.lazy) {
194+
delete inputProps.onInput;
195+
}
193196
if (!inputProps.autofocus) {
194197
delete inputProps.autofocus;
195198
}

components/input/TextArea.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const TextAreaProps = {
1616
showCount: PropTypes.looseBool,
1717
onCompositionstart: PropTypes.func,
1818
onCompositionend: PropTypes.func,
19+
valueModifiers: Object,
1920
};
2021

2122
export default defineComponent({
@@ -127,6 +128,9 @@ export default defineComponent({
127128
onChange: this.handleChange,
128129
onKeydown: this.handleKeyDown,
129130
};
131+
if (this.valueModifiers?.lazy) {
132+
delete resizeProps.onInput;
133+
}
130134
return (
131135
<ResizableTextArea
132136
{...resizeProps}

components/input/inputProps.ts

+1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ export default {
3232
onChange: PropTypes.func,
3333
onInput: PropTypes.func,
3434
'onUpdate:value': PropTypes.func,
35+
valueModifiers: Object,
3536
};

0 commit comments

Comments
 (0)