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

#472 Inline Blocks contenteditable=false fixes #473

Closed
wants to merge 23 commits into from

Conversation

MrAlexand0r
Copy link

  1. Element is getting split when it shouldn't
    image

  2. Strange behaviour when using the insert API after inserting a contenteditable false node,

    this.squire.insertPlainText('before', false);
    this.squire.insertElement(node);
    this.squire.insertPlainText('after', false);

image

  1. contenteditable false nodes are being merged
firefox_ZCvltc5qND.mp4

This pull requests fixes these bugs.

Alexander Gratzl added 4 commits November 29, 2024 12:13
@kyselberg
Copy link
Contributor

you probably are able to fix this issue without PR by wrapping your element in two element with contenteditable=false

<span contenteditable="false">
  <span contenteditable="false">
    {{ Placeholder }}
  </span>
</span>

@MrAlexand0r
Copy link
Author

MrAlexand0r commented Dec 2, 2024

@kyselberg I tried that just now, but same behaviour occurs.
Here is the Element I created:

<span tabindex="0" contenteditable="false" draggable="true" class="blot-boilerplate">
  <span contenteditable="false">
    Placeholder
  </span>
</span>

image

If you check the file changes, you will see that contenteditable="false" is only handeled correctly for block type elements

@kyselberg
Copy link
Contributor

i see
you r right, i used hack with contenteditable=false only to control cursor and hack with random class names to avoid collapsing.

@MrAlexand0r
Copy link
Author

MrAlexand0r commented Jan 21, 2025

I did not realize that I tried to pull request the main branch of my fork...
If this is something you want to merge I can create a new branch and cherry pick the relevant changes.

I can also create a code sandbox if you need some practical examples of the inline contenteditable="false" element bugs in action

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

Successfully merging this pull request may close these issues.

2 participants