-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Open
Labels
Description
Description
I’m opening a command palette when the user types "/".
This works perfectly on desktop browsers (Windows) , but on mobile browsers ( Android Chrome), the command palette never opens, even though the slash character appears in the editor. what is wrong? is keydown event not firing in android browser?
Here is my code:
const onKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {
if (
event.key === "/" &&
!isInsideCodeBlock(editor) &&
!showCommandPalette
) {
openCommandPalette();
return;
}
}
<Editable
renderElement={renderElement}
decorate={decorate}
renderLeaf={renderLeaf}
onDOMBeforeInput={handleRemovePlaceholderText}
onKeyDown={onKeyDown}
scrollSelectionIntoView={handleScrollSelectionIntoView}
className="focus-visible:outline-none flex-1 [&>*]:py-[3px] py-4 [&>*:nth-child(2)]:mt-1 break-words break-all whitespace-pre-wrap"
/>Recording