Skip to content

Commit e4cae96

Browse files
authored
fix: testing bugs in NumberField, Tooltip, and Popover (#9342)
* fix tooltip positioning * fix popover tip separation * fix numberfield infinite spin on mobile * make math more clear
1 parent 0caa399 commit e4cae96

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

packages/@react-aria/spinbutton/src/useSpinButton.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,8 @@ export function useSpinButton(
256256
if (!isSpinning.current && isUp.current) {
257257
onIncrement?.();
258258
}
259-
} else {
260-
clearAsync();
261259
}
260+
clearAsync();
262261
isUp.current = false;
263262
setIsIncrementPressed(null);
264263
},
@@ -296,9 +295,8 @@ export function useSpinButton(
296295
if (!isSpinning.current && isUp.current) {
297296
onDecrement?.();
298297
}
299-
} else {
300-
clearAsync();
301298
}
299+
clearAsync();
302300
isUp.current = false;
303301
setIsDecrementPressed(null);
304302
},

packages/@react-spectrum/s2/src/Popover.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ let arrow = style({
156156
},
157157
translateX: {
158158
placement: {
159-
left: -4,
160-
right: 4
159+
left: '-25%',
160+
right: '25%'
161161
}
162162
},
163163
strokeWidth: 1,

packages/@react-spectrum/s2/src/Tooltip.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ const tooltip = style<TooltipRenderProps & {colorScheme: ColorScheme | 'light da
6868
borderRadius: 'default',
6969
paddingX: 'edge-to-text',
7070
paddingY: centerPadding(),
71-
margin: 8,
7271
transition: 'default',
7372
transitionDuration: 200,
7473
transitionTimingFunction: {
@@ -165,7 +164,7 @@ export const Tooltip = forwardRef(function Tooltip(props: TooltipProps, ref: DOM
165164
arrowBoundaryOffset={borderRadius}
166165
containerPadding={containerPadding}
167166
crossOffset={crossOffset}
168-
offset={4}
167+
offset={4 + 5} // 4px offset + 5px arrow height
169168
placement={placement}
170169
shouldFlip={shouldFlip}
171170
ref={tooltipRef}

0 commit comments

Comments
 (0)