|
|
@ -122,23 +122,12 @@ class Tooltip extends React.Component<TooltipProps, any> { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
isHoverTrigger() { |
|
|
|
const { trigger } = this.props; |
|
|
|
if (!trigger || trigger === 'hover') { |
|
|
|
return true; |
|
|
|
} |
|
|
|
if (Array.isArray(trigger)) { |
|
|
|
return trigger.indexOf('hover') >= 0; |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
// Fix Tooltip won't hide at disabled button
|
|
|
|
// mouse events don't trigger at disabled button in Chrome
|
|
|
|
// https://github.com/react-component/tooltip/issues/18
|
|
|
|
getDisabledCompatibleChildren(element: React.ReactElement<any>) { |
|
|
|
if (((element.type as typeof Button).__ANT_BUTTON || element.type === 'button') && |
|
|
|
element.props.disabled && this.isHoverTrigger()) { |
|
|
|
element.props.disabled) { |
|
|
|
// Pick some layout related style properties up to span
|
|
|
|
// Prevent layout bugs like https://github.com/ant-design/ant-design/issues/5254
|
|
|
|
const { picked, omitted } = splitObject( |
|
|
|