Skip to content

Commit

Permalink
Don't focus query field on select (#5204)
Browse files Browse the repository at this point in the history
  • Loading branch information
WithoutPants authored Sep 3, 2024
1 parent 306ba63 commit a8a3b4c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui/v2.5/src/components/List/Filters/SelectableFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { CriterionModifier } from "src/core/generated-graphql";
import { keyboardClickHandler } from "src/utils/keyboard";
import { useDebounce } from "src/hooks/debounce";
import useFocus from "src/utils/focus";
import ScreenUtils from "src/utils/screen";

interface ISelectedItem {
item: ILabeledId;
Expand Down Expand Up @@ -235,7 +236,10 @@ export const ObjectsFilter = <
setDisplayQuery("");

// focus the input box
setInputFocus();
// don't do this on touch devices, as it's annoying
if (!ScreenUtils.isTouch()) {
setInputFocus();
}
}

const onUnselect = useCallback(
Expand Down

0 comments on commit a8a3b4c

Please sign in to comment.