mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 11:10:01 +08:00
fix: fix the error of missing custom icon className
This commit is contained in:
parent
2991e93b15
commit
71c79a3f75
@ -121,14 +121,23 @@ const InternalMenu = forwardRef<RcMenuRef, InternalMenuProps>((props, ref) => {
|
||||
const menuClassName = classNames(`${prefixCls}-${theme}`, className);
|
||||
|
||||
// ====================== Expand Icon ========================
|
||||
let mergedExpandIcon: MenuProps[`expandIcon`];
|
||||
if (typeof expandIcon === 'function') {
|
||||
mergedExpandIcon = expandIcon;
|
||||
} else {
|
||||
mergedExpandIcon = cloneElement(expandIcon || overrideObj.expandIcon, {
|
||||
className: `${prefixCls}-submenu-expand-icon`,
|
||||
});
|
||||
}
|
||||
const mergedExpandIcon: MenuProps[`expandIcon`] = (expandIconProps) => {
|
||||
const nonUnderwriteExpandIcon: any =
|
||||
typeof expandIcon === 'function'
|
||||
? expandIcon(expandIconProps)
|
||||
: expandIcon || overrideObj.expandIcon;
|
||||
|
||||
if (nonUnderwriteExpandIcon || nonUnderwriteExpandIcon === 0) {
|
||||
return cloneElement(nonUnderwriteExpandIcon, {
|
||||
className: classNames(
|
||||
`${prefixCls}-submenu-expand-icon`,
|
||||
nonUnderwriteExpandIcon?.props?.className,
|
||||
),
|
||||
});
|
||||
}
|
||||
|
||||
return <i className={`${prefixCls}-submenu-arrow`} />;
|
||||
};
|
||||
|
||||
// ======================== Context ==========================
|
||||
const contextValue = React.useMemo<MenuContextProps>(
|
||||
|
Loading…
Reference in New Issue
Block a user