Skip to content

Commit

Permalink
fixes #1154 - "isCaretAfterTag" is sometimes "true" and not an elemen…
Browse files Browse the repository at this point in the history
…t, so make sure it's an element before continuing
  • Loading branch information
Yair Even Or authored and Yair Even Or committed Dec 3, 2022
1 parent 903444c commit 6317fc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parts/events.js
Expand Up @@ -288,7 +288,7 @@ export default {
tagElmToBeDeleted,
firstTextNodeBeforeTag;

if( _s.backspace == 'edit' && isCaretAfterTag ){
if( _s.backspace == 'edit' && isCaretAfterTag instanceof Element ){
tagBeforeCaret = sel.anchorNode.nodeType == 1 ? null : sel.anchorNode.previousElementSibling;
setTimeout(this.editTag.bind(this), 0, tagBeforeCaret); // timeout is needed to the last cahacrter in the edited tag won't get deleted
e.preventDefault() // needed so the tag elm won't get deleted
Expand Down

0 comments on commit 6317fc7

Please sign in to comment.