mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 07:56:28 +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);
|
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', () => {
|
describe('Select Custom Icons', () => {
|
||||||
it('should support customized icons', () => {
|
it('should support customized icons', () => {
|
||||||
|
@ -19,7 +19,6 @@ import { getTransitionDirection, getTransitionName } from '../_util/motion';
|
|||||||
import type { InputStatus } from '../_util/statusUtils';
|
import type { InputStatus } from '../_util/statusUtils';
|
||||||
import { getMergedStatus, getStatusClassNames } from '../_util/statusUtils';
|
import { getMergedStatus, getStatusClassNames } from '../_util/statusUtils';
|
||||||
import getIcons from './utils/iconUtil';
|
import getIcons from './utils/iconUtil';
|
||||||
import warning from '../_util/warning';
|
|
||||||
|
|
||||||
import useStyle from './style';
|
import useStyle from './style';
|
||||||
import genPurePanel from '../_util/PurePanel';
|
import genPurePanel from '../_util/PurePanel';
|
||||||
@ -57,11 +56,6 @@ export interface SelectProps<
|
|||||||
placement?: SelectCommonPlacement;
|
placement?: SelectCommonPlacement;
|
||||||
mode?: 'multiple' | 'tags';
|
mode?: 'multiple' | 'tags';
|
||||||
status?: InputStatus;
|
status?: InputStatus;
|
||||||
/**
|
|
||||||
* @deprecated `dropdownClassName` is deprecated which will be removed in next major
|
|
||||||
* version.Please use `popupClassName` instead.
|
|
||||||
*/
|
|
||||||
dropdownClassName?: string;
|
|
||||||
popupClassName?: string;
|
popupClassName?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +67,6 @@ const InternalSelect = <OptionType extends BaseOptionType | DefaultOptionType =
|
|||||||
bordered = true,
|
bordered = true,
|
||||||
className,
|
className,
|
||||||
getPopupContainer,
|
getPopupContainer,
|
||||||
dropdownClassName,
|
|
||||||
popupClassName,
|
popupClassName,
|
||||||
listHeight = 256,
|
listHeight = 256,
|
||||||
placement,
|
placement,
|
||||||
@ -120,13 +113,6 @@ const InternalSelect = <OptionType extends BaseOptionType | DefaultOptionType =
|
|||||||
const mergedShowArrow =
|
const mergedShowArrow =
|
||||||
showArrow !== undefined ? showArrow : props.loading || !(isMultiple || mode === 'combobox');
|
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 =====================
|
// ===================== Form Status =====================
|
||||||
const {
|
const {
|
||||||
status: contextStatus,
|
status: contextStatus,
|
||||||
@ -159,7 +145,7 @@ const InternalSelect = <OptionType extends BaseOptionType | DefaultOptionType =
|
|||||||
const selectProps = omit(props as typeof props & { itemIcon: any }, ['suffixIcon', 'itemIcon']);
|
const selectProps = omit(props as typeof props & { itemIcon: any }, ['suffixIcon', 'itemIcon']);
|
||||||
|
|
||||||
const rcSelectRtlDropdownClassName = classNames(
|
const rcSelectRtlDropdownClassName = classNames(
|
||||||
popupClassName || dropdownClassName,
|
popupClassName,
|
||||||
{
|
{
|
||||||
[`${prefixCls}-dropdown-${direction}`]: direction === 'rtl',
|
[`${prefixCls}-dropdown-${direction}`]: direction === 'rtl',
|
||||||
},
|
},
|
||||||
|
@ -15,4 +15,5 @@
|
|||||||
- 组件 `dropdownClassName` 替换为 `popupClassName`
|
- 组件 `dropdownClassName` 替换为 `popupClassName`
|
||||||
- AutoComplete 组件
|
- AutoComplete 组件
|
||||||
- Cascader 组件
|
- Cascader 组件
|
||||||
|
- Select 组件
|
||||||
- open 属性转换:https://github.com/ant-design/ant-design/issues/36609
|
- open 属性转换:https://github.com/ant-design/ant-design/issues/36609
|
||||||
|
Loading…
Reference in New Issue
Block a user