Skip to content

Commit

Permalink
fix: [button] 优化集合按钮下拉面板逻辑 fix #918
Browse files Browse the repository at this point in the history
  • Loading branch information
liangfeng_wang authored and albyben committed Oct 31, 2024
1 parent 5db5f89 commit 31cae27
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/button/group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import classNames from 'classnames'
import ConfigContext from '../config-provider/ConfigContext'
import { getCompProps } from '../_utils'
import { Button, Icon } from '../index'
import usePopper, { PopperProps } from '../_utils/usePopper'
import { toArray } from '../_utils/react-children'
import { tuple } from '../_utils/type'
import { ButtonType, ButtonSize } from './button'
import Popper, { PopperProps } from '../popper'

export const ButtonGroupTypes = tuple('basic', 'similar')
export type ButtonGroupType = typeof ButtonGroupTypes[number]
Expand Down Expand Up @@ -150,7 +150,11 @@ const InternalButtonGroup = (props: ButtonGroupProps, ref: unknown): FunctionCom
getTriggerElement: (locatorNode: HTMLElement) => (isBsicType ? locatorNode : triggerRef.current),
}

return usePopper(renderTriggerButton(), renderContent(), popperProps)
return (
<Popper tip={renderContent()} {...popperProps}>
{renderTriggerButton()}
</Popper>
)
}

const ButtonGroup = React.forwardRef<HTMLDivElement, ButtonGroupProps>(InternalButtonGroup)
Expand Down

0 comments on commit 31cae27

Please sign in to comment.