Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export const EmojisListDropdown = forwardRef<EmojiListRef, EmojisListDropdownPro
/>
<div
ref={dropdownContainerRef}
id="emojis-picker"
className={cn(
"relative max-h-80 w-[14rem] overflow-y-auto rounded-md border-[0.5px] border-custom-border-300 bg-custom-background-100 px-2 py-2.5 shadow-custom-shadow-rg space-y-2 opacity-0 invisible transition-opacity",
{
Expand Down
1 change: 1 addition & 0 deletions packages/editor/src/core/extensions/emoji/emoji.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export const pasteRegex = /:([a-zA-Z0-9_+-]+):/g;

export const Emoji = Node.create<EmojiOptions, EmojiStorage>({
name: "emoji",
priority: 1001,

inline: true,

Expand Down
7 changes: 7 additions & 0 deletions packages/editor/src/core/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ export const CoreEditorProps = (props: TArgs): EditorProps => {
handleDOMEvents: {
keydown: (_view, event) => {
// prevent default event listeners from firing when slash command is active
if (["Enter"].includes(event.key)) {
const emojisPicker = document.querySelector("#emojis-picker");
if (emojisPicker) {
return true;
}
}

if (["ArrowUp", "ArrowDown", "Enter"].includes(event.key)) {
const slashCommand = document.querySelector("#slash-command");
if (slashCommand) {
Expand Down
Loading