mac support for search
This commit is contained in:
parent
e510262c03
commit
e233cf866f
2 changed files with 34 additions and 31 deletions
File diff suppressed because one or more lines are too long
|
@ -14,9 +14,12 @@ const LogContainerDiv = styled.div`
|
|||
export function LogContainer() {
|
||||
const { state } = useContext(store);
|
||||
|
||||
const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
|
||||
const ctrlKey = isMac ? "metaKey" : "ctrlKey";
|
||||
|
||||
useEffect(() => {
|
||||
const listener = function (e: KeyboardEvent) {
|
||||
if (e.ctrlKey && e.code === "KeyF") {
|
||||
if (e.key === 'f' && e[ctrlKey]) {
|
||||
e.preventDefault();
|
||||
if (state.activeSearchField) {
|
||||
state.activeSearchField.focus();
|
||||
|
|
Loading…
Reference in a new issue