Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Dropdown.Button's dropdownRender is not executed #38862

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions components/dropdown/__tests__/dropdown-button.test.tsx
Expand Up @@ -145,4 +145,10 @@ describe('DropdownButton', () => {
expect(errSpy).not.toHaveBeenCalled();
errSpy.mockRestore();
});

it('should support dropdownRender', () => {
const dropdownRender = jest.fn((menu) => <div>Custom Menu {menu}</div>);
render(<DropdownButton open dropdownRender={dropdownRender} />);
expect(dropdownRender).toHaveBeenCalled();
});
});
2 changes: 2 additions & 0 deletions components/dropdown/dropdown-button.tsx
Expand Up @@ -69,6 +69,7 @@ const DropdownButton: DropdownButtonInterface = (props) => {
overlayClassName,
overlayStyle,
destroyPopupOnHide,
dropdownRender,
...restProps
} = props;

Expand All @@ -90,6 +91,7 @@ const DropdownButton: DropdownButtonInterface = (props) => {
overlayClassName,
overlayStyle,
destroyPopupOnHide,
dropdownRender,
};

const { compactSize, compactItemClassnames } = useCompactItemContext(prefixCls, direction);
Expand Down