angular2-mentions
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -87,3 +87,4 @@ "use strict"; | ||
else if (this.startPos >= 0 && !this.stopSearch) { | ||
if (!event.shiftKey && | ||
// ignore shift when pressed alone, but not when used with another key | ||
if (event.keyCode !== KEY_SHIFT && | ||
!event.metaKey && | ||
@@ -139,8 +140,8 @@ !event.altKey && | ||
// update search | ||
var mention = val.substring(this.startPos, pos); | ||
var mention = val.substring(this.startPos + 1, pos); | ||
if (event.keyCode !== KEY_BACKSPACE) { | ||
mention += charPressed; | ||
} | ||
var regEx_1 = new RegExp("^" + mention.substring(1), "i"); | ||
var matches = this.items.filter(function (e) { return e.match(regEx_1) != null; }); | ||
var searchString_1 = mention.toLowerCase(); | ||
var matches = this.items.filter(function (e) { return e.toLowerCase().startsWith(searchString_1); }); | ||
this.searchList.items = matches; | ||
@@ -147,0 +148,0 @@ this.searchList.hidden = matches.length == 0 || pos <= this.startPos; |
{ | ||
"name": "angular2-mentions", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "Angular 2 mentions for text fields.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
44657
697