diff --git a/packages/polaris-viz/CHANGELOG.md b/packages/polaris-viz/CHANGELOG.md
index 829a05a54..d959bbcee 100644
--- a/packages/polaris-viz/CHANGELOG.md
+++ b/packages/polaris-viz/CHANGELOG.md
@@ -16,6 +16,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
### Changed
- Changed `` tooltip positioning to align with the crosshair when on a touch device.
+- Changed `` tooltip positioning to align with the top of the chart on a touch device.
## [15.3.5] - 2024-12-05
diff --git a/packages/polaris-viz/src/components/TooltipWrapper/utilities/getAlteredVerticalBarPosition.ts b/packages/polaris-viz/src/components/TooltipWrapper/utilities/getAlteredVerticalBarPosition.ts
index 410267921..d2345abfd 100644
--- a/packages/polaris-viz/src/components/TooltipWrapper/utilities/getAlteredVerticalBarPosition.ts
+++ b/packages/polaris-viz/src/components/TooltipWrapper/utilities/getAlteredVerticalBarPosition.ts
@@ -30,7 +30,20 @@ export function getAlteredVerticalBarPosition(
//
// Y POSITIONING
//
- if (!props.isPerformanceImpacted) {
+ if (props.isPerformanceImpacted || props.isTouchDevice) {
+ y = clamp({
+ amount:
+ props.containerBounds.y -
+ props.tooltipDimensions.height -
+ (scrollContainer?.scrollTop ?? 0),
+ min: 0,
+ max:
+ window.scrollY +
+ window.innerHeight -
+ props.tooltipDimensions.height -
+ TOOLTIP_MARGIN,
+ });
+ } else {
if (newPosition.vertical === TooltipVerticalOffset.Inline) {
newPosition.horizontal = TooltipHorizontalOffset.Left;
@@ -60,19 +73,6 @@ export function getAlteredVerticalBarPosition(
newPosition.horizontal = TooltipHorizontalOffset.Left;
}
}
- } else {
- y = clamp({
- amount:
- (props.chartBounds.y ?? 0) -
- props.tooltipDimensions.height -
- (scrollContainer?.scrollTop ?? 0),
- min: 0,
- max:
- window.scrollY +
- window.innerHeight -
- props.tooltipDimensions.height -
- TOOLTIP_MARGIN,
- });
}
//