Prevent input field from focusing on touch devices rather than mobile (#6105)

This commit is contained in:
WithoutPants 2025-10-06 07:44:59 +11:00 committed by GitHub
parent 15bf28d5be
commit af76f4a24a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -30,9 +30,9 @@ export const FilteredSidebarHeader: React.FC<{
const [, setFocus] = focus;
// 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(() => {
if (sidebarOpen && !ScreenUtils.isMobile()) {
if (sidebarOpen && !ScreenUtils.isTouch()) {
setFocus();
}
}, [sidebarOpen, setFocus]);