fix: Action行为按钮组件修复 tooltip 部分属性配置不生效问题 (#3994)

Co-authored-by: ”jiatianqi“ <”jiatianqi@baidu.com“>
This commit is contained in:
Ma ke 2022-04-08 10:49:30 +08:00 committed by GitHub
parent 4b501dc52b
commit 4f35ec2a89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -827,8 +827,8 @@ export class Action extends React.Component<ActionProps, ActionState> {
disabled={disabled}
componentClass={isMenuItem ? 'a' : componentClass}
overrideClassName={isMenuItem}
tooltip={filterContents(tooltip, data)}
disabledTip={filterContents(disabledTip, data)}
tooltip={tooltip}
disabledTip={disabledTip}
tooltipPlacement={tooltipPlacement}
tooltipContainer={tooltipContainer}
tooltipTrigger={tooltipTrigger}

View File

@ -56,7 +56,7 @@ export function filterContents(
tooltip:
| string
| undefined
| {title?: string; render?: any; content?: string; body?: string},
| {title?: string; children?: any; content?: string; body?: string},
data: any
) {
if (typeof tooltip === 'string') {
@ -64,7 +64,7 @@ export function filterContents(
} else if (tooltip) {
return tooltip.title
? {
render: tooltip.render ? () => tooltip.render(data) : undefined,
children: tooltip?.children,
title: filter(tooltip.title, data),
content:
tooltip.content || tooltip.body