Skip to content

Commit 59f5bb8

Browse files
authored
Slider - Increased hit target (#3531)
* Increased default thumb hit slop * Added hitslop to Incubator.Slider thumb * Added hitslop to all thumbs * Removed extra const * Removed extra line * Revert old slider index changes * Revert old slider index changes
1 parent 4158f3f commit 59f5bb8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/incubator/slider/Thumb.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,21 @@ interface ThumbProps extends ViewProps {
2828

2929
const SHADOW_RADIUS = 4;
3030
const THUMB_SIZE = 24;
31+
const THUMB_ACCESSIBLE_HITSLOP = Math.max(0, 48 - THUMB_SIZE) / 2;
32+
const DEFAULT_THUMB_HIT_SLOP = {
33+
top: THUMB_ACCESSIBLE_HITSLOP,
34+
bottom: THUMB_ACCESSIBLE_HITSLOP,
35+
left: THUMB_ACCESSIBLE_HITSLOP,
36+
right: THUMB_ACCESSIBLE_HITSLOP
37+
} as const;
3138

3239
const Thumb = (props: ThumbProps) => {
3340
const {
3441
disabled,
3542
disableActiveStyling,
3643
activeStyle,
3744
defaultStyle,
38-
hitSlop,
45+
hitSlop = DEFAULT_THUMB_HIT_SLOP,
3946
onSeekStart,
4047
onSeekEnd,
4148
start,

0 commit comments

Comments
 (0)