mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 14:13:37 +08:00
chore: adjust tooltip for cov (#40013)
* chore: adjust tooltip for cov * chore: update bug version
This commit is contained in:
parent
c8bc3ce6c6
commit
3539e668f7
@ -231,25 +231,25 @@ const Tooltip = React.forwardRef<unknown, TooltipProps>((props, ref) => {
|
||||
placements[key].points![0] === align.points?.[0] &&
|
||||
placements[key].points![1] === align.points?.[1],
|
||||
);
|
||||
if (!placement) {
|
||||
return;
|
||||
}
|
||||
// 根据当前坐标设置动画点
|
||||
const rect = domNode.getBoundingClientRect();
|
||||
|
||||
const transformOrigin = { top: '50%', left: '50%' };
|
||||
if (placement) {
|
||||
// 根据当前坐标设置动画点
|
||||
const rect = domNode.getBoundingClientRect();
|
||||
|
||||
if (/top|Bottom/.test(placement)) {
|
||||
transformOrigin.top = `${rect.height - align.offset![1]}px`;
|
||||
} else if (/Top|bottom/.test(placement)) {
|
||||
transformOrigin.top = `${-align.offset![1]}px`;
|
||||
const transformOrigin = { top: '50%', left: '50%' };
|
||||
|
||||
if (/top|Bottom/.test(placement)) {
|
||||
transformOrigin.top = `${rect.height - align.offset![1]}px`;
|
||||
} else if (/Top|bottom/.test(placement)) {
|
||||
transformOrigin.top = `${-align.offset![1]}px`;
|
||||
}
|
||||
if (/left|Right/.test(placement)) {
|
||||
transformOrigin.left = `${rect.width - align.offset![0]}px`;
|
||||
} else if (/right|Left/.test(placement)) {
|
||||
transformOrigin.left = `${-align.offset![0]}px`;
|
||||
}
|
||||
domNode.style.transformOrigin = `${transformOrigin.left} ${transformOrigin.top}`;
|
||||
}
|
||||
if (/left|Right/.test(placement)) {
|
||||
transformOrigin.left = `${rect.width - align.offset![0]}px`;
|
||||
} else if (/right|Left/.test(placement)) {
|
||||
transformOrigin.left = `${-align.offset![0]}px`;
|
||||
}
|
||||
domNode.style.transformOrigin = `${transformOrigin.left} ${transformOrigin.top}`;
|
||||
};
|
||||
|
||||
const getOverlay = () => {
|
||||
|
@ -26,6 +26,7 @@ const DEPRECIATED_VERSION = {
|
||||
'5.0.4': ['https://github.com/ant-design/ant-design/issues/39284'],
|
||||
'5.0.6': ['https://github.com/ant-design/ant-design/issues/39807'],
|
||||
'5.1.0': ['https://github.com/react-component/drawer/pull/370'],
|
||||
'5.1.2': ['https://github.com/ant-design/ant-design/issues/39949'],
|
||||
};
|
||||
|
||||
function matchDeprecated(version) {
|
||||
|
Loading…
Reference in New Issue
Block a user