Skip to content

Commit

Permalink
fix: 🐛 add inline nodnes cursor support for firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
Saul-Mirone committed May 26, 2022
1 parent e9d15d3 commit d20e7e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/plugin-emoji/src/node.ts
Expand Up @@ -31,7 +31,7 @@ export const emojiNode = createNode<string, EmojiOptions>((utils, options) => {
schema: () => ({
group: 'inline',
inline: true,
selectable: false,
atom: true,
attrs: {
html: {
default: '',
Expand Down
5 changes: 4 additions & 1 deletion packages/preset-commonmark/src/plugin/inline-nodes-cursor.ts
Expand Up @@ -52,10 +52,13 @@ export const inlineNodesCursorPlugin: Plugin = new Plugin({
const leftDec = Decoration.widget(position, left, {
side: -1,
});
const right = document.createElement('span');
const rightDec = Decoration.widget(position, right);
setTimeout(() => {
left.contentEditable = 'true';
right.contentEditable = 'true';
});
return DecorationSet.create(state.doc, [leftDec]);
return DecorationSet.create(state.doc, [leftDec, rightDec]);
}
return DecorationSet.empty;
},
Expand Down

1 comment on commit d20e7e3

@vercel
Copy link

@vercel vercel bot commented on d20e7e3 May 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.