fix(tooltip): rename arrow-offset-horizontal to arrow-offset-x CSS variable to fix transformOrigin (#56887)

The variable name was inconsistent and caused transformOrigin to not properly reference
the arrow position for animations.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
二货爱吃白萝卜
2026-02-06 14:37:55 +08:00
committed by GitHub
parent 8a16c49f5c
commit 2950b7da98
3 changed files with 6 additions and 6 deletions

View File

@@ -108,7 +108,7 @@ const genBaseStyle: GenerateStyle<PopoverToken> = (token) => {
userSelect: 'text',
// When use `autoArrow`, origin will follow the arrow position
[varName('valid-offset-x')]: varRef('arrow-offset-horizontal', 'var(--arrow-x)'),
[varName('valid-offset-x')]: varRef('arrow-offset-x', 'var(--arrow-x)'),
transformOrigin: [
varRef('valid-offset-x', FALL_BACK_ORIGIN),
`var(--arrow-y, ${FALL_BACK_ORIGIN})`,

View File

@@ -106,7 +106,7 @@ const getArrowStyle = <
},
'&-placement-topLeft': {
[varName('arrow-offset-horizontal')]: arrowOffsetHorizontal,
[varName('arrow-offset-x')]: arrowOffsetHorizontal,
[`> ${componentCls}-arrow`]: {
left: {
@@ -117,7 +117,7 @@ const getArrowStyle = <
},
'&-placement-topRight': {
[varName('arrow-offset-horizontal')]: `calc(100% - ${unit(arrowOffsetHorizontal)})`,
[varName('arrow-offset-x')]: `calc(100% - ${unit(arrowOffsetHorizontal)})`,
[`> ${componentCls}-arrow`]: {
right: {
@@ -148,7 +148,7 @@ const getArrowStyle = <
},
'&-placement-bottomLeft': {
[varName('arrow-offset-horizontal')]: arrowOffsetHorizontal,
[varName('arrow-offset-x')]: arrowOffsetHorizontal,
[`> ${componentCls}-arrow`]: {
left: {
@@ -159,7 +159,7 @@ const getArrowStyle = <
},
'&-placement-bottomRight': {
[varName('arrow-offset-horizontal')]: `calc(100% - ${unit(arrowOffsetHorizontal)})`,
[varName('arrow-offset-x')]: `calc(100% - ${unit(arrowOffsetHorizontal)})`,
[`> ${componentCls}-arrow`]: {
right: {

View File

@@ -83,7 +83,7 @@ const genTooltipStyle: GenerateStyle<TooltipToken> = (token) => {
const sharedTransformOrigin: CSSObject = {
// When use `autoArrow`, origin will follow the arrow position
[varName('valid-offset-x')]: varRef('arrow-offset-horizontal', 'var(--arrow-x)'),
[varName('valid-offset-x')]: varRef('arrow-offset-x', 'var(--arrow-x)'),
transformOrigin: [
varRef('valid-offset-x', FALL_BACK_ORIGIN),
`var(--arrow-y, ${FALL_BACK_ORIGIN})`,