Rename mode name

This commit is contained in:
Wei Zhu 2018-06-25 11:58:00 +08:00 committed by 偏右
parent 5eaa03b4ea
commit 6de4b00815
3 changed files with 5 additions and 5 deletions

View File

@ -121,7 +121,7 @@ export default class AutoComplete extends React.Component<AutoCompleteProps, {}>
<Select
{...this.props}
className={cls}
mode={Select.COMBOBOX_MODE}
mode={Select.SECRET_COMBOBOX_MODE_DO_NOT_USE}
optionLabelProp={optionLabelProp}
getInputElement={this.getInputElement}
notFoundContent={notFoundContent}

View File

@ -37,7 +37,7 @@ describe('Select', () => {
it('should not have default notFoundContent when mode is combobox', () => {
const wrapper = mount(
<Select mode={Select.COMBOBOX_MODE} />
<Select mode={Select.SECRET_COMBOBOX_MODE_DO_NOT_USE} />
);
wrapper.find('.ant-select').simulate('click');
jest.runAllTimers();
@ -47,7 +47,7 @@ describe('Select', () => {
it('should not have notFoundContent when mode is combobox and notFoundContent is set', () => {
const wrapper = mount(
<Select mode={Select.COMBOBOX_MODE} notFoundContent="not at all" />
<Select mode={Select.SECRET_COMBOBOX_MODE_DO_NOT_USE} notFoundContent="not at all" />
);
wrapper.find('.ant-select').simulate('click');
jest.runAllTimers();

View File

@ -91,7 +91,7 @@ export default class Select extends React.Component<SelectProps, {}> {
static Option = Option as React.ClassicComponentClass<OptionProps>;
static OptGroup = OptGroup as React.ClassicComponentClass<OptGroupProps>;
static COMBOBOX_MODE = 'SECRET_COMBOBOX_MODE_DO_NOT_USE';
static SECRET_COMBOBOX_MODE_DO_NOT_USE = 'SECRET_COMBOBOX_MODE_DO_NOT_USE';
static defaultProps = {
prefixCls: 'ant-select',
@ -138,7 +138,7 @@ export default class Select extends React.Component<SelectProps, {}> {
isCombobox() {
const { mode } = this.props;
return mode === 'combobox' || mode === Select.COMBOBOX_MODE;
return mode === 'combobox' || mode === Select.SECRET_COMBOBOX_MODE_DO_NOT_USE;
}
renderSelect = (locale: SelectLocale) => {