Skip to content

Commit

Permalink
fix selection loss when checking/unchecking list
Browse files Browse the repository at this point in the history
  • Loading branch information
jhchen committed Aug 20, 2018
1 parent 5258163 commit 54fd8be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion formats/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ class ListItem extends Block {
constructor(scroll, domNode) {
super(scroll, domNode);
const ui = domNode.ownerDocument.createElement('span');
const listEventHandler = () => {
const listEventHandler = e => {
if (!scroll.isEnabled()) return;
const format = this.statics.formats(domNode, scroll);
if (format === 'checked') {
this.format('list', 'unchecked');
e.preventDefault();
} else if (format === 'unchecked') {
this.format('list', 'checked');
e.preventDefault();
}
};
ui.addEventListener('mousedown', listEventHandler);
Expand Down

0 comments on commit 54fd8be

Please sign in to comment.