mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-19 06:43:16 +08:00
feat: replace dropdownClassName to popupClassName (#37091)
This commit is contained in:
parent
a2605f757d
commit
fc2b64e6ab
@ -91,15 +91,6 @@ describe('Select', () => {
|
||||
expect(container.querySelectorAll('.anticon-search').length).toBe(1);
|
||||
});
|
||||
|
||||
it('should show warning when use dropdownClassName', () => {
|
||||
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
||||
render(<Select dropdownClassName="myCustomClassName" />);
|
||||
expect(errorSpy).toHaveBeenCalledWith(
|
||||
'Warning: [antd: Select] `dropdownClassName` is deprecated which will be removed in next major version. Please use `popupClassName` instead.',
|
||||
);
|
||||
errorSpy.mockRestore();
|
||||
});
|
||||
|
||||
//
|
||||
describe('Select Custom Icons', () => {
|
||||
it('should support customized icons', () => {
|
||||
|
@ -19,7 +19,6 @@ import { getTransitionDirection, getTransitionName } from '../_util/motion';
|
||||
import type { InputStatus } from '../_util/statusUtils';
|
||||
import { getMergedStatus, getStatusClassNames } from '../_util/statusUtils';
|
||||
import getIcons from './utils/iconUtil';
|
||||
import warning from '../_util/warning';
|
||||
|
||||
import useStyle from './style';
|
||||
import genPurePanel from '../_util/PurePanel';
|
||||
@ -57,11 +56,6 @@ export interface SelectProps<
|
||||
placement?: SelectCommonPlacement;
|
||||
mode?: 'multiple' | 'tags';
|
||||
status?: InputStatus;
|
||||
/**
|
||||
* @deprecated `dropdownClassName` is deprecated which will be removed in next major
|
||||
* version.Please use `popupClassName` instead.
|
||||
*/
|
||||
dropdownClassName?: string;
|
||||
popupClassName?: string;
|
||||
}
|
||||
|
||||
@ -73,7 +67,6 @@ const InternalSelect = <OptionType extends BaseOptionType | DefaultOptionType =
|
||||
bordered = true,
|
||||
className,
|
||||
getPopupContainer,
|
||||
dropdownClassName,
|
||||
popupClassName,
|
||||
listHeight = 256,
|
||||
placement,
|
||||
@ -120,13 +113,6 @@ const InternalSelect = <OptionType extends BaseOptionType | DefaultOptionType =
|
||||
const mergedShowArrow =
|
||||
showArrow !== undefined ? showArrow : props.loading || !(isMultiple || mode === 'combobox');
|
||||
|
||||
// =================== Warning =====================
|
||||
warning(
|
||||
!dropdownClassName,
|
||||
'Select',
|
||||
'`dropdownClassName` is deprecated which will be removed in next major version. Please use `popupClassName` instead.',
|
||||
);
|
||||
|
||||
// ===================== Form Status =====================
|
||||
const {
|
||||
status: contextStatus,
|
||||
@ -159,7 +145,7 @@ const InternalSelect = <OptionType extends BaseOptionType | DefaultOptionType =
|
||||
const selectProps = omit(props as typeof props & { itemIcon: any }, ['suffixIcon', 'itemIcon']);
|
||||
|
||||
const rcSelectRtlDropdownClassName = classNames(
|
||||
popupClassName || dropdownClassName,
|
||||
popupClassName,
|
||||
{
|
||||
[`${prefixCls}-dropdown-${direction}`]: direction === 'rtl',
|
||||
},
|
||||
|
@ -15,4 +15,5 @@
|
||||
- 组件 `dropdownClassName` 替换为 `popupClassName`
|
||||
- AutoComplete 组件
|
||||
- Cascader 组件
|
||||
- Select 组件
|
||||
- open 属性转换:https://github.com/ant-design/ant-design/issues/36609
|
||||
|
Loading…
Reference in New Issue
Block a user