diff --git a/js/lib/d3.combobox.js b/js/lib/d3.combobox.js index 97a2fe3cd..27a2a9ba5 100644 --- a/js/lib/d3.combobox.js +++ b/js/lib/d3.combobox.js @@ -180,11 +180,16 @@ d3.combobox = function() { }); } + function isCursorNotAtEnd() { + return input.property('selectionStart') < input.property('value').length; + } + function autocomplete() { var v = caseSensitive ? value() : value().toLowerCase(); idx = -1; - if (!v) return; + if (!v) return; + v = isCursorNotAtEnd() ? input.property('value'): v; for (var i = 0; i < suggestions.length; i++) { var suggestion = suggestions[i].value, compare = caseSensitive ? suggestion : suggestion.toLowerCase();