chore: adjust tooltip for cov (#40013)

* chore: adjust tooltip for cov

* chore: update bug version
This commit is contained in:
二货爱吃白萝卜 2023-01-04 22:40:35 +08:00 committed by GitHub
parent c8bc3ce6c6
commit 3539e668f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 16 deletions

View File

@ -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 = () => {

View File

@ -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) {