Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PRO]: When the current block contains an emoji, the mod+backspace shortcut key does not work properly. #6082

Open
1 task done
ludafa opened this issue Feb 4, 2025 · 2 comments
Labels
Category: Pro The issue or pull request is related to the pro packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@ludafa
Copy link

ludafa commented Feb 4, 2025

Affected Packages

emoji

Version(s)

2.0.0

Description of the Bug

When the current block contains an emoji, the mod+backspace shortcut key does not work properly.

I tried on the official template page

iShot_2025-02-04_11.53.01.mp4
iShot_2025-02-04_12.01.19.mp4

Browser Used

Chrome

Code Example (Preferred)

https://templates.tiptap.dev/CBGr8nzzW8

Expected Behavior

It should delete all inline nodes from current cursor to the begin while press mod+backspace.

Additional Context (Optional)

No response

Dependency Updates

  • Yes, I've updated all my dependencies.
@ludafa ludafa added Category: Pro The issue or pull request is related to the pro packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Feb 4, 2025
@guanriyue
Copy link
Contributor

This is probably an issue with the browser itself. I will demonstrate using the most basic contenteditable rich text element.

Pressing Command + Delete triggers an input event: deleteSoftLineBackward. The function of this event is as follows.

delete from the caret to the nearest visual line break before the caret position.
https://www.w3.org/TR/input-events-2/#interface-InputEvent-Attributes:~:text=deleteSoftLineBackward

But when a node (e.g., a span) has contenteditable set to false, display set to inline-block (the same applies to inline-flex and inline-grid), and it is positioned at the beginning of the current line, Command + Delete will fail.

A workaround may be needed to resolve this issue. Essentially, this behavior is caused by the browser itself.

2025-02-05.19.41.27.mov

@ludafa
Copy link
Author

ludafa commented Feb 6, 2025

I tested on Chrome, if set to contenteditable=true, the emoji component seems to work fine as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Pro The issue or pull request is related to the pro packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
None yet
Development

No branches or pull requests

2 participants