small caret fix

This commit is contained in:
Peter Savchenko 2018-05-29 19:15:24 +03:00
commit f8043ff959
No known key found for this signature in database
GPG key ID: 63E739583C761566
3 changed files with 13 additions and 1 deletions

View file

@ -2688,6 +2688,12 @@ var Caret = function (_Module) {
*/
var firstLetterPosition = anchorNode.textContent.search(/\S/);
if (firstLetterPosition === -1) {
// empty text
firstLetterPosition = 0;
}
if (nothingAtLeft && selection.anchorOffset === firstLetterPosition) {
return true;

File diff suppressed because one or more lines are too long

View file

@ -233,6 +233,12 @@ export default class Caret extends Module {
*/
let firstLetterPosition = anchorNode.textContent.search(/\S/);
if (firstLetterPosition === -1) { // empty text
firstLetterPosition = 0;
}
if (nothingAtLeft && selection.anchorOffset === firstLetterPosition) {
return true;