Merge pull request #286 from rangermeier/master
False selection detection when typing something into input
This commit is contained in:
commit
05ccc0a5cb
@ -10,8 +10,8 @@ var h = require('../../lib/helper')
|
|||||||
function bindSelectionHandler(element, i) {
|
function bindSelectionHandler(element, i) {
|
||||||
function getRangeNode() {
|
function getRangeNode() {
|
||||||
var selection = window.getSelection ? window.getSelection() :
|
var selection = window.getSelection ? window.getSelection() :
|
||||||
document.getSlection ? document.getSlection() : {rangeCount: 0};
|
document.getSelection ? document.getSelection() : '';
|
||||||
if (selection.rangeCount === 0) {
|
if (selection.toString().length === 0) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return selection.getRangeAt(0).commonAncestorContainer;
|
return selection.getRangeAt(0).commonAncestorContainer;
|
||||||
|
Loading…
Reference in New Issue
Block a user