refactor: change dom attribute maxLength to maxlength
parent
248b7bbed2
commit
00069605c0
|
@ -157,10 +157,6 @@ export default {
|
|||
onInput: handleChange,
|
||||
onChange: noop,
|
||||
};
|
||||
// vue bug ?
|
||||
if (inputProps.maxLength === undefined) {
|
||||
delete inputProps.maxLength;
|
||||
}
|
||||
if (!inputProps.autoFocus) {
|
||||
delete inputProps.autoFocus;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Input should support maxLength 1`] = `<input type="text" maxlength="3" class="ant-input">`;
|
||||
exports[`Input should support maxlength 1`] = `<input type="text" maxlength="3" class="ant-input">`;
|
||||
|
||||
exports[`Input.Search should support suffix 1`] = `<span class="ant-input-search ant-input-affix-wrapper"><input type="text" class="ant-input"><span class="ant-input-suffix">suffix<span role="img" aria-label="search" tabindex="-1" class="anticon anticon-search ant-input-search-icon"><svg viewBox="64 64 896 896" focusable="false" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" class=""><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></span></span>`;
|
||||
|
||||
exports[`TextArea should support disabled 1`] = `<textarea disabled="disabled" class="ant-input ant-input-disabled"></textarea>`;
|
||||
|
||||
exports[`TextArea should support maxLength 1`] = `<textarea maxlength="10" class="ant-input"></textarea>`;
|
||||
exports[`TextArea should support maxlength 1`] = `<textarea maxlength="10" class="ant-input"></textarea>`;
|
||||
|
|
|
@ -11,8 +11,8 @@ describe('Input', () => {
|
|||
focusTest(TextArea);
|
||||
focusTest(Password);
|
||||
|
||||
it('should support maxLength', async () => {
|
||||
const wrapper = mount(Input, { attrs: { maxLength: 3 }, sync: false });
|
||||
it('should support maxlength', async () => {
|
||||
const wrapper = mount(Input, { attrs: { maxlength: 3 }, sync: false });
|
||||
await asyncExpect(() => {
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
}, 0);
|
||||
|
@ -63,8 +63,8 @@ describe('TextArea', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('should support maxLength', async () => {
|
||||
const wrapper = mount(TextArea, { attrs: { maxLength: 10 }, sync: false });
|
||||
it('should support maxlength', async () => {
|
||||
const wrapper = mount(TextArea, { attrs: { maxlength: 10 }, sync: false });
|
||||
await asyncExpect(() => {
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
});
|
||||
|
|
|
@ -30,6 +30,6 @@ export default {
|
|||
default: true,
|
||||
type: Boolean,
|
||||
},
|
||||
maxLength: PropTypes.number,
|
||||
maxlength: PropTypes.number,
|
||||
loading: PropTypes.bool,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue