二货爱吃白萝卜
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
17 additions and
4 deletions
-
components/table/__tests__/Table.filter.test.tsx
-
components/table/hooks/useFilter/FilterWrapper.tsx
|
|
@ -134,6 +134,8 @@ describe('Table.filter', () => { |
|
|
|
}); |
|
|
|
|
|
|
|
it('renders empty menu correctly', () => { |
|
|
|
resetWarned(); |
|
|
|
|
|
|
|
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); |
|
|
|
const { container } = render( |
|
|
|
createTable({ |
|
|
|
|
|
@ -13,10 +13,21 @@ const onKeyDown: React.KeyboardEventHandler<HTMLDivElement> = (event) => { |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
const FilterDropdownMenuWrapper: React.FC<FilterDropdownMenuWrapperProps> = (props) => ( |
|
|
|
<div className={props.className} onClick={(e) => e.stopPropagation()} onKeyDown={onKeyDown}> |
|
|
|
const FilterDropdownMenuWrapper = React.forwardRef<HTMLDivElement, FilterDropdownMenuWrapperProps>( |
|
|
|
(props, ref) => ( |
|
|
|
<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; |
|
|
|