Skip to content

Commit

Permalink
mitigation for #1910
Browse files Browse the repository at this point in the history
  • Loading branch information
jhchen committed Jan 18, 2018
1 parent 7d82d63 commit 6918897
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import extend from 'extend';
import Delta from 'quill-delta';
import DeltaOp from 'quill-delta/lib/op';
import Parchment from 'parchment';
import Embed from '../blots/embed';
import Quill from '../core/quill';
import logger from '../core/logger';
import Module from '../core/module';
Expand Down Expand Up @@ -307,14 +306,15 @@ function makeEmbedArrowHandler(key, shiftKey) {
return {
key,
shiftKey,
altKey: null,
[where]: /^$/,
handler: function(range) {
let index = range.index;
if (key === Keyboard.keys.RIGHT) {
index += (range.length + 1);
}
const [leaf, ] = this.quill.getLeaf(index);
if (!(leaf instanceof Embed)) return true;
if (!(leaf instanceof Parchment.Embed)) return true;
if (key === Keyboard.keys.LEFT) {
if (shiftKey) {
this.quill.setSelection(range.index - 1, range.length + 1, Quill.sources.USER);
Expand Down

0 comments on commit 6918897

Please # to comment.