fix: CMD+F not working on screens with keyboard shortcut guide (#2066)

This commit is contained in:
Tom Moor
2021-04-23 12:10:02 -07:00
committed by GitHub
parent a818c7a924
commit eb6acdae20
8 changed files with 143 additions and 117 deletions

View File

@@ -3,7 +3,7 @@ import * as React from "react";
import { useTranslation } from "react-i18next";
import styled from "styled-components";
import Flex from "components/Flex";
import Input from "components/InputSearch";
import InputSearch from "components/InputSearch";
import Key from "components/Key";
import { metaDisplay } from "utils/keyboard";
@@ -351,7 +351,7 @@ function KeyboardShortcuts() {
}, []);
const handleKeyDown = React.useCallback((event) => {
if (event.target.value && event.key === "Escape") {
if (event.currentTarget.value && event.key === "Escape") {
event.preventDefault();
event.stopPropagation();
setSearchTerm("");
@@ -360,12 +360,10 @@ function KeyboardShortcuts() {
return (
<Flex column>
<Input
type="search"
<InputSearch
onChange={handleChange}
onKeyDown={handleKeyDown}
value={searchTerm}
redirectDisabled
/>
{categories.map((category, x) => {
const filtered = searchTerm