mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
test: offset solution
ref: https://github.com/ant-design/ant-design/pull/38828
This commit is contained in:
parent
6b2ec60e42
commit
aacf9c3378
@ -111,10 +111,13 @@ const Badge: CompoundedComponent = ({
|
||||
}
|
||||
|
||||
const offsetStyle: React.CSSProperties = { marginTop: offset[1] };
|
||||
const offsetX = parseInt(offset[0] as string, 10);
|
||||
|
||||
if (direction === 'rtl') {
|
||||
offsetStyle.left = parseInt(offset[0] as string, 10);
|
||||
offsetStyle.left = -offsetX;
|
||||
offsetStyle.transform = 'translate(-50%, -50%)';
|
||||
} else {
|
||||
offsetStyle.right = -parseInt(offset[0] as string, 10);
|
||||
offsetStyle.right = -offsetX;
|
||||
}
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user