Commit 4671cebf authored by dmacfarlane's avatar dmacfarlane
Browse files

fix: avoid regex error if symbol chars used

parent 3bd4cf6d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -155,12 +155,12 @@ export class MentionDirective {
        }
        else {
          // update search
          let mention = val.substring(this.startPos, pos);
          let mention = val.substring(this.startPos + 1, pos);
          if (event.keyCode !== KEY_BACKSPACE) {
            mention += charPressed;
          }
          let regEx = new RegExp("^" + mention.substring(1), "i");
          let matches = this.items.filter(e => e.match(regEx) != null);
          let searchString = mention.toLowerCase();
          let matches = this.items.filter(e => e.toLowerCase().startsWith(searchString));
          this.searchList.items = matches;
          this.searchList.hidden = matches.length == 0 || pos <= this.startPos;
        }