Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/@react-aria/overlays/src/usePreventScroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ function preventScrollMobileSafari() {
allowTouchMove = true;
}

// If this is a range input, allow touch move to allow user to adjust the slider value
if (e.composedPath().some((el) =>
el instanceof HTMLInputElement &&
el.type === 'range'
)) {
allowTouchMove = true;
}

// If this is a focused input element with a selected range, allow user to drag the selection handles.
if (
'selectionStart' in target &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ function App(): JSX.Element {
<ActionButton onPress={startPreventScroll} margin="20px">
Click Me in safari and then scroll
</ActionButton>

<p>Should be able to scroll the range input on iOS Safari</p>
<input type="range" />
</div>
);
}