From 5aa6427152c77957ea7e2f797bf3f73f879b1299 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Thu, 28 Oct 2021 13:34:47 -0400 Subject: [PATCH] Only listen to CMD+f for on macOS Signed-off-by: Sebastian Malton --- src/renderer/components/input/search-input.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/renderer/components/input/search-input.tsx b/src/renderer/components/input/search-input.tsx index 21ba82e493..1f29bc0dae 100644 --- a/src/renderer/components/input/search-input.tsx +++ b/src/renderer/components/input/search-input.tsx @@ -26,6 +26,7 @@ import { observer } from "mobx-react"; import { boundMethod, cssNames } from "../../utils"; import { Icon } from "../icon"; import { Input, InputProps } from "./input"; +import { isMac } from "../../../common/vars"; interface Props extends InputProps { compact?: boolean; // show only search-icon when not focused @@ -38,9 +39,7 @@ const defaultProps: Partial = { autoFocus: true, bindGlobalFocusHotkey: true, showClearIcon: true, - get placeholder() { - return `Search...`; - }, + placeholder: "Search...", }; @observer @@ -60,9 +59,7 @@ export class SearchInput extends React.Component { @boundMethod onGlobalKey(evt: KeyboardEvent) { - const meta = evt.metaKey || evt.ctrlKey; - - if (meta && evt.key === "f") { + if (evt.key === "f" && (isMac ? evt.metaKey : evt.ctrlKey)) { this.inputRef.current.focus(); } }