Skip to content

Commit 2950b7d

Browse files
zombieJclaude
andauthored
fix(tooltip): rename arrow-offset-horizontal to arrow-offset-x CSS variable to fix transformOrigin (ant-design#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>
1 parent 8a16c49 commit 2950b7d

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

components/popover/style/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const genBaseStyle: GenerateStyle<PopoverToken> = (token) => {
108108
userSelect: 'text',
109109

110110
// When use `autoArrow`, origin will follow the arrow position
111-
[varName('valid-offset-x')]: varRef('arrow-offset-horizontal', 'var(--arrow-x)'),
111+
[varName('valid-offset-x')]: varRef('arrow-offset-x', 'var(--arrow-x)'),
112112
transformOrigin: [
113113
varRef('valid-offset-x', FALL_BACK_ORIGIN),
114114
`var(--arrow-y, ${FALL_BACK_ORIGIN})`,

components/style/placementArrow.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const getArrowStyle = <
106106
},
107107

108108
'&-placement-topLeft': {
109-
[varName('arrow-offset-horizontal')]: arrowOffsetHorizontal,
109+
[varName('arrow-offset-x')]: arrowOffsetHorizontal,
110110

111111
[`> ${componentCls}-arrow`]: {
112112
left: {
@@ -117,7 +117,7 @@ const getArrowStyle = <
117117
},
118118

119119
'&-placement-topRight': {
120-
[varName('arrow-offset-horizontal')]: `calc(100% - ${unit(arrowOffsetHorizontal)})`,
120+
[varName('arrow-offset-x')]: `calc(100% - ${unit(arrowOffsetHorizontal)})`,
121121

122122
[`> ${componentCls}-arrow`]: {
123123
right: {
@@ -148,7 +148,7 @@ const getArrowStyle = <
148148
},
149149

150150
'&-placement-bottomLeft': {
151-
[varName('arrow-offset-horizontal')]: arrowOffsetHorizontal,
151+
[varName('arrow-offset-x')]: arrowOffsetHorizontal,
152152

153153
[`> ${componentCls}-arrow`]: {
154154
left: {
@@ -159,7 +159,7 @@ const getArrowStyle = <
159159
},
160160

161161
'&-placement-bottomRight': {
162-
[varName('arrow-offset-horizontal')]: `calc(100% - ${unit(arrowOffsetHorizontal)})`,
162+
[varName('arrow-offset-x')]: `calc(100% - ${unit(arrowOffsetHorizontal)})`,
163163

164164
[`> ${componentCls}-arrow`]: {
165165
right: {

components/tooltip/style/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const genTooltipStyle: GenerateStyle<TooltipToken> = (token) => {
8383

8484
const sharedTransformOrigin: CSSObject = {
8585
// When use `autoArrow`, origin will follow the arrow position
86-
[varName('valid-offset-x')]: varRef('arrow-offset-horizontal', 'var(--arrow-x)'),
86+
[varName('valid-offset-x')]: varRef('arrow-offset-x', 'var(--arrow-x)'),
8787
transformOrigin: [
8888
varRef('valid-offset-x', FALL_BACK_ORIGIN),
8989
`var(--arrow-y, ${FALL_BACK_ORIGIN})`,

0 commit comments

Comments
 (0)