Skip to content

Commit

Permalink
fix: add extra pass
Browse files Browse the repository at this point in the history
  • Loading branch information
coding-ice committed Oct 24, 2024
1 parent d7bb0e0 commit e5ce601
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion assets/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
display: flex;
align-items: center;

.@{menuPrefixCls}-extra {
.@{menuPrefixCls}-item-extra {
margin-left: auto;
font-size: 14px;
}
Expand Down
4 changes: 2 additions & 2 deletions src/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type { MenuInfo, MenuItemType } from './interface';
import { warnItemProp } from './utils/warnUtil';

export interface MenuItemProps
extends Omit<MenuItemType, 'label' | 'key'| 'ref'>,
extends Omit<MenuItemType, 'label' | 'key' | 'ref'>,
Omit<
React.HTMLAttributes<HTMLLIElement>,
'onClick' | 'onMouseEnter' | 'onMouseLeave' | 'onSelect'
Expand Down Expand Up @@ -209,7 +209,7 @@ const InternalMenuItem = React.forwardRef(
role={role === null ? 'none' : role || 'menuitem'}
tabIndex={disabled ? null : -1}
data-menu-id={overflowDisabled && domDataId ? null : domDataId}
{...restProps}
{...omit(restProps, ['extra'])}
{...activeProps}
{...optionRoleProps}
component="li"
Expand Down
2 changes: 1 addition & 1 deletion src/utils/nodeUtil.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function convertItemsToNodes(
}

return (
<MergedMenuItem key={mergedKey} {...restProps}>
<MergedMenuItem key={mergedKey} {...restProps} extra={extra}>
{label}
{(!!extra || extra === 0) && (
<span className={`${prefixCls}-item-extra`}>{extra}</span>
Expand Down

0 comments on commit e5ce601

Please sign in to comment.