Skip to content

Commit

Permalink
fix(docs): remove autoFocus on webkit
Browse files Browse the repository at this point in the history
  • Loading branch information
jrgarciadev committed Aug 4, 2023
1 parent 043b42c commit bf88c02
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions apps/docs/components/cmdk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {usePathname, useRouter} from "next/navigation";
import MultiRef from "react-multi-ref";
import {clsx} from "@nextui-org/shared-utils";
import scrollIntoView from "scroll-into-view-if-needed";
import {isAppleDevice} from "@react-aria/utils";
import {isAppleDevice, isWebKit} from "@react-aria/utils";
import {create} from "zustand";
import {intersectionBy, isEmpty} from "lodash";
import {writeStorage, useLocalStorage} from "@rehooks/local-storage";
Expand Down Expand Up @@ -194,8 +194,6 @@ export const Cmdk: FC<{}> = () => {
};

document.addEventListener("keydown", onKeyDown);

return () => document.removeEventListener("keydown", onKeyDown);
}, [isOpen]);

const onItemSelect = useCallback(
Expand Down Expand Up @@ -366,14 +364,14 @@ export const Cmdk: FC<{}> = () => {
placement="top-center"
scrollBehavior="inside"
size="xl"
onClose={onClose}
onClose={() => onClose()}
>
<ModalContent>
<Command className={slots.base()} label="Quick search command" shouldFilter={false}>
<div className={slots.header()}>
<SearchLinearIcon className={slots.searchIcon()} strokeWidth={2} />
<Command.Input
autoFocus
autoFocus={!isWebKit()}
className={slots.input()}
placeholder="Search documentation"
value={query}
Expand Down

0 comments on commit bf88c02

Please sign in to comment.