Skip to content

Shift + Enter Keyboard Shortcut Not Working in Quill 2.0.2 #4248

@ghost

Description

Hi Quill Team,

I am currently using Quill 2.0.2 on Windows 10 with Firefox 126.0.1. I encountered an issue with the "Shift + Enter" keyboard shortcut: it does not seem to work as expected. Specifically, when I press "Shift + Enter" while writing text in the editor, it always creates a new paragraph (

) instead of inserting a line break (
).

Here is a snippet of my current implementation:

var quill = new Quill('#editor', {
  theme: 'snow'
});

quill.keyboard.addBinding({
  key: 13,  // Enter key
  shiftKey: true
}, function(range, context) {
  quill.insertText(range.index, '\n');
  quill.setSelection(range.index + 1);
});

Could you help me understand what might be going wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions