fix(spellchecker): Make sure spellchecker returns selection to its original state

This also fixes the scenario where the link editor wouldn't pop up properly with
misspelled words.
This commit is contained in:
Halla Moore 2016-07-28 13:41:03 -07:00
parent 44d8d823a0
commit 0b82543c44

View file

@ -146,7 +146,7 @@ export default class SpellcheckComposerExtension extends ComposerExtension {
selectionSnapshot[`${prop}Node`] = afterMatchNode;
selectionSnapshot[`${prop}Offset`] -= match.index + match[0].length;
selectionSnapshot.modified = true;
} else if (selectionSnapshot[`${prop}Offset`] > match.index) {
} else if (selectionSnapshot[`${prop}Offset`] >= match.index) {
selectionSnapshot[`${prop}Node`] = spellingSpan.childNodes[0];
selectionSnapshot[`${prop}Offset`] -= match.index;
selectionSnapshot.modified = true;