fix: AutoComplete custom input element className (#29725)

* test: add test case

* upgrade select version

* fix test case

* fix snapshot
This commit is contained in:
afc163 2021-03-11 23:11:51 +08:00 committed by GitHub
parent a4a009cb62
commit fbe02ceed3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -153,7 +153,7 @@ exports[`renders ./components/auto-complete/demo/custom.md correctly 1`] = `
aria-haspopup="listbox"
aria-owns="undefined_list"
autocomplete="off"
class="ant-input ant-select-selection-search-input"
class="ant-input ant-select-selection-search-input custom"
placeholder="input here"
role="combobox"
style="height:50px"

View File

@ -1,6 +1,7 @@
import React from 'react';
import { mount } from 'enzyme';
import AutoComplete from '..';
import Input from '../../input';
import mountTest from '../../../tests/shared/mountTest';
import rtlTest from '../../../tests/shared/rtlTest';
@ -78,4 +79,13 @@ describe('AutoComplete', () => {
// eslint-disable-next-line no-console
console.warn.mockRestore();
});
it('should not override custom input className', () => {
const wrapper = mount(
<AutoComplete>
<Input className="custom" />
</AutoComplete>,
);
expect(wrapper.find('input').hasClass('custom')).toBe(true);
});
});

View File

@ -136,7 +136,7 @@
"rc-progress": "~3.1.0",
"rc-rate": "~2.9.0",
"rc-resize-observer": "^1.0.0",
"rc-select": "~12.1.0",
"rc-select": "~12.1.6",
"rc-slider": "~9.7.1",
"rc-steps": "~4.1.0",
"rc-switch": "~3.2.0",