Skip to content

Commit

Permalink
fix: always hide tooltip onEnd of cartesian pangesture (#230)
Browse files Browse the repository at this point in the history
Co-authored-by: Eli Zibin <[email protected]>
  • Loading branch information
peterjskaltsis and zibs authored Apr 10, 2024
1 parent 4f31231 commit 0bbf3f4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/empty-tigers-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"victory-native": patch
---

fix: add onEnd callback for cartesian pangesture
12 changes: 12 additions & 0 deletions lib/src/cartesian/CartesianChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,18 @@ export function CartesianChart<
touchMap.value[touch.id] = undefined;
}
})
/**
* Once the gesture ends, ensure all active values are falsified.
*/
.onEnd(() => {
const vals = activePressSharedValues || [];
// Set active state to false for all vals
for (const val of vals) {
if (val) {
val.isActive.value = false;
}
}
})
/**
* Activate after a long press, which helps with preventing all touch hijacking.
* This is important if this chart is inside of some sort of scrollable container.
Expand Down

0 comments on commit 0bbf3f4

Please sign in to comment.