Skip to content

Commit 31c8339

Browse files
committed
fix: remove textarea maxlength support emoji
1 parent af2e268 commit 31c8339

File tree

4 files changed

+4
-162
lines changed

4 files changed

+4
-162
lines changed

components/input/Input.tsx

Lines changed: 0 additions & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -347,163 +347,4 @@ export default defineComponent({
347347
);
348348
};
349349
},
350-
351-
// methods: {
352-
// handleInputFocus(e: Event) {
353-
// this.isFocused = true;
354-
// this.onFocus && this.onFocus(e);
355-
// },
356-
357-
// handleInputBlur(e: Event) {
358-
// this.isFocused = false;
359-
// this.onBlur && this.onBlur(e);
360-
// this.formItemContext.onFieldBlur();
361-
// },
362-
363-
// focus() {
364-
// this.input.focus();
365-
// },
366-
367-
// blur() {
368-
// this.input.blur();
369-
// },
370-
// select() {
371-
// this.input.select();
372-
// },
373-
374-
// saveClearableInput(input: HTMLInputElement) {
375-
// this.clearableInput = input;
376-
// },
377-
378-
// saveInput(input: HTMLInputElement) {
379-
// this.input = input;
380-
// },
381-
382-
// setValue(value: string | number, callback?: Function) {
383-
// if (this.stateValue === value) {
384-
// return;
385-
// }
386-
// if (!hasProp(this, 'value')) {
387-
// this.stateValue = value;
388-
// } else {
389-
// (this as any).$forceUpdate();
390-
// }
391-
// nextTick(() => {
392-
// callback && callback();
393-
// });
394-
// },
395-
// triggerChange(e: Event) {
396-
// this.$emit('update:value', (e.target as HTMLInputElement).value);
397-
// this.$emit('change', e);
398-
// this.$emit('input', e);
399-
// this.formItemContext.onFieldChange();
400-
// },
401-
// handleReset(e: Event) {
402-
// this.setValue('', () => {
403-
// this.focus();
404-
// });
405-
// resolveOnChange(this.input, e, this.triggerChange);
406-
// },
407-
// renderInput(prefixCls: string, { addonBefore, addonAfter }) {
408-
// const otherProps = omit(this.$props, [
409-
// 'prefixCls',
410-
// 'onPressEnter',
411-
// 'addonBefore',
412-
// 'addonAfter',
413-
// 'prefix',
414-
// 'suffix',
415-
// 'allowClear',
416-
// 'defaultValue',
417-
// 'lazy',
418-
// 'size',
419-
// 'inputPrefixCls',
420-
// 'loading',
421-
// ]);
422-
// const {
423-
// handleKeyDown,
424-
// handleChange,
425-
// handleInputFocus,
426-
// handleInputBlur,
427-
// size,
428-
// disabled,
429-
// valueModifiers = {},
430-
// $attrs,
431-
// } = this;
432-
// const inputProps: any = {
433-
// ...otherProps,
434-
// ...$attrs,
435-
// id: otherProps.id ?? this.formItemContext.id.value,
436-
// onKeydown: handleKeyDown,
437-
// class: classNames(getInputClassName(prefixCls, size, disabled), {
438-
// [$attrs.class as string]: $attrs.class && !addonBefore && !addonAfter,
439-
// }),
440-
// ref: this.saveInput,
441-
// key: 'ant-input',
442-
// onInput: handleChange,
443-
// onChange: handleChange,
444-
// onFocus: handleInputFocus,
445-
// onBlur: handleInputBlur,
446-
// };
447-
// if (valueModifiers.lazy) {
448-
// delete inputProps.onInput;
449-
// }
450-
// if (!inputProps.autofocus) {
451-
// delete inputProps.autofocus;
452-
// }
453-
// const inputNode = <input {...inputProps} />;
454-
// return withDirectives(inputNode as VNode, [[antInputDirective]]);
455-
// },
456-
// clearPasswordValueAttribute() {
457-
// // https://github.com/ant-design/ant-design/issues/20541
458-
// this.removePasswordTimeout = setTimeout(() => {
459-
// if (
460-
// this.input &&
461-
// this.input.getAttribute &&
462-
// this.input.getAttribute('type') === 'password' &&
463-
// this.input.hasAttribute('value')
464-
// ) {
465-
// this.input.removeAttribute('value');
466-
// }
467-
// });
468-
// },
469-
// handleChange(e: Event) {
470-
// const { value, composing, isComposing } = e.target as any;
471-
// // https://github.com/vueComponent/ant-design-vue/issues/2203
472-
// if (((isComposing || composing) && this.lazy) || this.stateValue === value) return;
473-
// this.setValue(value, this.clearPasswordValueAttribute);
474-
// resolveOnChange(this.input, e, this.triggerChange);
475-
// },
476-
// handleKeyDown(e: KeyboardEvent) {
477-
// if (e.keyCode === 13) {
478-
// this.$emit('pressEnter', e);
479-
// }
480-
// this.$emit('keydown', e);
481-
// },
482-
// },
483-
// render() {
484-
// const { prefixCls: customizePrefixCls } = this.$props;
485-
// const { stateValue, isFocused } = this.$data;
486-
// const getPrefixCls = this.configProvider.getPrefixCls;
487-
// const prefixCls = getPrefixCls('input', customizePrefixCls);
488-
// const addonAfter = getComponent(this, 'addonAfter');
489-
// const addonBefore = getComponent(this, 'addonBefore');
490-
// const suffix = getComponent(this, 'suffix');
491-
// const prefix = getComponent(this, 'prefix');
492-
// const props: any = {
493-
// ...this.$attrs,
494-
// ...getOptionProps(this),
495-
// prefixCls,
496-
// inputType: 'input',
497-
// value: fixControlledValue(stateValue),
498-
// element: this.renderInput(prefixCls, { addonAfter, addonBefore }),
499-
// handleReset: this.handleReset,
500-
// addonAfter,
501-
// addonBefore,
502-
// suffix,
503-
// prefix,
504-
// isFocused,
505-
// };
506-
507-
// return <ClearableLabeledInput {...props} ref={this.saveClearableInput} />;
508-
// },
509350
});

components/input/ResizableTextArea.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ const ResizableTextArea = defineComponent({
104104
'allowClear',
105105
'type',
106106
'lazy',
107+
'maxlength',
107108
]);
108109
const cls = classNames(prefixCls, attrs.class, {
109110
[`${prefixCls}-disabled`]: disabled,

components/input/__tests__/__snapshots__/demo.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ exports[`renders ./components/input/demo/search-input.vue correctly 1`] = `<div>
8888
8989
exports[`renders ./components/input/demo/search-input-loading.vue correctly 1`] = `<div><span class="ant-input-group-wrapper ant-input-search"><span class="ant-input-wrapper ant-input-group"><!----><input placeholder="input search loading deault" type="text" class="ant-input"><span class="ant-input-group-addon"><button class="ant-btn ant-btn-loading ant-input-search-button ant-btn-icon-only" type="button"><span role="img" aria-label="loading" class="anticon anticon-loading"><svg focusable="false" class="anticon-spin" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="0 0 1024 1024"><path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg></span></button></span></span></span><br><br><span class="ant-input-group-wrapper ant-input-search ant-input-search-with-button"><span class="ant-input-wrapper ant-input-group"><!----><input placeholder="input search loading with enterButton" type="text" class="ant-input"><span class="ant-input-group-addon"><button class="ant-btn ant-btn-primary ant-btn-loading ant-input-search-button" type="button"><span role="img" aria-label="loading" class="anticon anticon-loading"><svg focusable="false" class="anticon-spin" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="0 0 1024 1024"><path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg></span><span role="img" aria-label="search" class="anticon anticon-search"><svg focusable="false" class="" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg></span></button></span></span></span></div>`;
9090
91-
exports[`renders ./components/input/demo/show-count.vue correctly 1`] = `<div class="ant-input-textarea ant-input-textarea-show-count" data-count="10 / 100"><textarea maxlength="100" class="ant-input"></textarea></div>`;
91+
exports[`renders ./components/input/demo/show-count.vue correctly 1`] = `<div class="ant-input-textarea ant-input-textarea-show-count" data-count="10 / 100"><textarea class="ant-input"></textarea></div>`;
9292
9393
exports[`renders ./components/input/demo/size.vue correctly 1`] = `<div class="components-input-demo-size"><input placeholder="large size" type="text" class="ant-input ant-input-lg"><input placeholder="default size" type="text" class="ant-input"><input placeholder="small size" type="text" class="ant-input ant-input-sm"></div>`;
9494

components/input/__tests__/__snapshots__/index.test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ exports[`Input.Search should support suffix 1`] = `<span class="ant-input-group-
66
77
exports[`TextArea should support disabled 1`] = `<textarea disabled="" class="ant-input ant-input-disabled"></textarea>`;
88
9-
exports[`TextArea should support maxlength 1`] = `<textarea maxlength="10" class="ant-input"></textarea>`;
9+
exports[`TextArea should support maxlength 1`] = `<textarea class="ant-input"></textarea>`;
1010
11-
exports[`TextArea should support showCount 1`] = `<div class="ant-input-textarea ant-input-textarea-show-count" data-count="3 / 10"><textarea maxlength="10" class="ant-input"></textarea></div>`;
11+
exports[`TextArea should support showCount 1`] = `<div class="ant-input-textarea ant-input-textarea-show-count" data-count="3 / 10"><textarea class="ant-input"></textarea></div>`;

0 commit comments

Comments
 (0)