JoaquinLarra
JoaquinLarra

Reputation: 117

Summernote: Enter key not working

I'm using summernote (http://hackerwins.github.io/summernote/features.html) text editor in conjunction with jquery and jquery forms.

Actually there are other libraries implemented.

Thing is when enter key is pressed nothing happens.

Is there a solution / patch for this?

Upvotes: 0

Views: 4117

Answers (2)

arjun nile
arjun nile

Reputation: 1

There is "callback" events to catch key events on summernote editor. But summernote has only keyup and keydown events.

// onKeydown callback

$('#summernote').summernote({

      callbacks: {
    
        onKeydown: function(e) {
          console.log('Key is downed:', e.keyCode);
        }
      }
    });

// summernote.keydown

$('#summernote').on('summernote.keydown', function(we, e) {

  console.log('Key is downed:', e.keyCode);

});

Upvotes: 0

Mike Devenney
Mike Devenney

Reputation: 1845

There is probably a script somewhere that is disabling the Enter key. This is often done in forms to prevent accidental form submission when the user hits enter. If there is a form on the page, inspect the scripts loaded to see if there is an onKeyPress even handler that is checking for something like this:

$('html').bind('keypress', function(e)
{
   if(e.keyCode == 13)
   {
      return false;
   }
});

If so, that's your problem.

Upvotes: 1

Related Questions