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

Fixing incorrect deletion in case of embed blot #3568

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Commits on Apr 21, 2022

  1. Fixing incorrect deletion in case of embed blot

    Embedblots have a left guard and a right guard. On placing the cursor after an embedblot and pressing backspace, the character just before embed blot is deleted instead of the embed blot. This is because the getSelection api returns incorrect value (actual value -1). This was happening because in the normalizedToRange function, the node was correctly found to be the right guard dom node, with an offset of zero. The index was also correctly found to be the index of the embed blot. However, before the offset had a change to be corrected by calling the blot.index(node,offset) function (which would have returned 1 for right guard), the incorrect value was returned by the if statement above it. 
    
    FIX: Move the check for LeafBlot above the offset===0 check.
    rishavag1995 committed Apr 21, 2022
    Configuration menu
    Copy the full SHA
    954e648 View commit details
    Browse the repository at this point in the history