Skip to content

Commit

Permalink
Emit single change when typing enter on empty list line (slab#2279)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbbakst authored and jhchen committed Aug 29, 2018
1 parent 8d9e3ab commit e864bf6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions modules/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,16 @@ Keyboard.DEFAULTS = {
format: ['list'],
empty: true,
handler(range, context) {
this.quill.format('list', false, Quill.sources.USER);
const formats = { list: false };
if (context.format.indent) {
this.quill.format('indent', false, Quill.sources.USER);
formats.indent = false;
}
this.quill.formatLine(
range.index,
range.length,
formats,
Quill.sources.USER,
);
},
},
'checklist enter': {
Expand Down

0 comments on commit e864bf6

Please sign in to comment.