mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 16:34:02 +01:00
Prevent input field from focusing on touch devices rather than mobile (#6105)
This commit is contained in:
parent
15bf28d5be
commit
af76f4a24a
1 changed files with 2 additions and 2 deletions
|
|
@ -30,9 +30,9 @@ export const FilteredSidebarHeader: React.FC<{
|
||||||
const [, setFocus] = focus;
|
const [, setFocus] = focus;
|
||||||
|
|
||||||
// Set the focus on the input field when the sidebar is opened
|
// Set the focus on the input field when the sidebar is opened
|
||||||
// Don't do this on mobile devices
|
// Don't do this on touch devices
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (sidebarOpen && !ScreenUtils.isMobile()) {
|
if (sidebarOpen && !ScreenUtils.isTouch()) {
|
||||||
setFocus();
|
setFocus();
|
||||||
}
|
}
|
||||||
}, [sidebarOpen, setFocus]);
|
}, [sidebarOpen, setFocus]);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue