-
Notifications
You must be signed in to change notification settings - Fork 668
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
Feature/remove zwj contenteditable false #394
Feature/remove zwj contenteditable false #394
Conversation
@ichord, this is ready for review. Please let me know if there are any changes that can be made to get this merged. Thanks! |
if (range = this._getRange()) { | ||
range.setEndAfter(this.query.el[0]); | ||
range.collapse(false); | ||
range.insertNode(suffixNode = this.app.document.createTextNode("\u200D" + suffix)); | ||
range.insertNode(suffixNode = this.app.document.createTextNode + suffix); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leb2dg Should it be this.app.document.createTextNode(suffix) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops I see you fix it in the next commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I can clean up the commits and resolve the conflicts on this 👍
Closing in favor of #423 |
It may be beneficial if it was an option to use
contenteditable="false"
instead of the&zwj
.Purpose
Fix unusual
contenteditable
behavior in WebKit browsers as described in #393.Changes
contenteditable="false"
to inserted spanSide effects
Deleting the mention/emoji deletes the trigger (@, :, etc.).
Using
contenteditable="false"
may cause unexpected behavior in old browsers or IE. I only tested this in Chrome, Firefox, and Safari. This article from 2014 describes a bug when usingcontenteditable="false"
in Chrome and Safari but I couldn't reproduce it so it appears to be fixed.