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

[color-inline] In Safari, editable content is fully wiped out on pressing delete #14

Open
DmitrySharabin opened this issue May 6, 2024 · 3 comments

Comments

@DmitrySharabin
Copy link
Member

No matter whether you're trying to delete a highlighted part of a text or not.

Testcase

<color-inline contentEditable>lch(50% 40 30)</color-inline>
@LeaVerou LeaVerou changed the title In Safari, editable content is fully wiped out on pressing delete [color-inline] In Safari, editable content is fully wiped out on pressing delete May 7, 2024
@DmitrySharabin
Copy link
Member Author

The issue is that the mutated text node does not have a parent node in Safari (it's null),

target = target.parentNode;

so the parent <color-inline> is not found, and <color-inline> is not appropriately re-rendered—this line

target.#render();
is not being called.

@DmitrySharabin
Copy link
Member Author

DmitrySharabin commented May 20, 2024

It works as expected with contenteditable="plaintext-only" instead of contenteditable.

@DmitrySharabin
Copy link
Member Author

This behavior is reproducible in standard HTML elements. 🤦‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant