mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
fix: Table filter throw react warning (#43139)
This commit is contained in:
parent
209f062131
commit
ec29ebf2c9
@ -134,6 +134,8 @@ describe('Table.filter', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('renders empty menu correctly', () => {
|
it('renders empty menu correctly', () => {
|
||||||
|
resetWarned();
|
||||||
|
|
||||||
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
||||||
const { container } = render(
|
const { container } = render(
|
||||||
createTable({
|
createTable({
|
||||||
|
@ -13,10 +13,21 @@ const onKeyDown: React.KeyboardEventHandler<HTMLDivElement> = (event) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const FilterDropdownMenuWrapper: React.FC<FilterDropdownMenuWrapperProps> = (props) => (
|
const FilterDropdownMenuWrapper = React.forwardRef<HTMLDivElement, FilterDropdownMenuWrapperProps>(
|
||||||
<div className={props.className} onClick={(e) => e.stopPropagation()} onKeyDown={onKeyDown}>
|
(props, ref) => (
|
||||||
{props.children}
|
<div
|
||||||
</div>
|
className={props.className}
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
onKeyDown={onKeyDown}
|
||||||
|
ref={ref}
|
||||||
|
>
|
||||||
|
{props.children}
|
||||||
|
</div>
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV !== 'production') {
|
||||||
|
FilterDropdownMenuWrapper.displayName = 'FilterDropdownMenuWrapper';
|
||||||
|
}
|
||||||
|
|
||||||
export default FilterDropdownMenuWrapper;
|
export default FilterDropdownMenuWrapper;
|
||||||
|
Loading…
Reference in New Issue
Block a user