question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG With : Merge pull request #3113 from gioboa/bugfix/#3112

See original GitHub issue

Description of your Issue or Request:

I just installed the last summnote version 0.8.12 and what a surprise when I use my customs buttons that use range selection.

I have a button that change “case”. It doesn’t work anymore because of the merge #3113

steps to reproduce (Add more if necessary):

In my custom button :

click: function () {
      var rangeSelection = $('#' + $('#localActiveId').val()).summernote('createRange');
      console.log(rangeSelection)
      var searchSelection = rangeSelection.toString();
      console.log(searchSelection);
      if(typeof searchSelection !== 'undefined' && searchSelection.trim() != "") {
        //-- si première lettre minuscule : majuscule
        if(searchSelection.trim()[0].toLowerCase() == searchSelection.trim()[0]) {
          searchSelection = searchSelection.toUpperCase();
        }
        else{
          searchSelection = searchSelection.toLowerCase();
        }
        context.invoke("editor.insertText", searchSelection);
      }
    }

searchSelection is cutted… It missed some text. With the version 0.8.11 it works perfectly then I searched a little.

In the merge pull I see this : w3cRange.setEnd(this.ec, this.sc.data ? Math.min(this.eo, this.sc.data.length) : this.eo); This doesn’t work on long text (more than one node !)

I think It must be : w3cRange.setEnd(this.ec, this.ec.data ? Math.min(this.eo, this.ec.data.length) : this.eo); (or w3cRange.setEnd(this.ec, this.sc.data ? Math.max(this.eo, this.sc.data.length) : this.eo);)

What is your Operating System, Browser and Version and Summernote Version you are using:

This can help find and resolve any issues.

  1. Operating System: w10

  2. Browser and Version: All

  3. Summernote Version: 0.8.12

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jokamaxcommented, May 20, 2020

@DiemenDesign I don’t know why exactly but with the v0.8.17 : everything is now OK I close the ticket

1reaction
jokamaxcommented, Mar 16, 2020

@DiemenDesign impossible because : #3592

I tried to make a patch but the old correction with #3592 is a problem. Impossible to see if the patch is needed with the new version 😉.

When release with #3592 is OK : I see

Read more comments on GitHub >

github_iconTop Results From Across the Web

git - My pull request has been merged, what to do next?
What to do next is: going on contributing new features or fixing other bugs in their own dedicated branches (pushed only to your...
Read more >
About pull requests and permissions - Azure Repos
Pull requests (PRs) are a way to change, review, and merge code in a Git repository on Azure Repos. PRs can come from...
Read more >
Pull request merges fail with the "New changes were pushed ...
Issue Summary. When merging a pull request, the user received the following message: New changes were pushed to <branch> in <project>/<repository> while the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found