Commit e55bb7f0 authored by dmacfarlane's avatar dmacfarlane
Browse files

Disable browser autocomplete

parent 96478812
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -27,7 +27,8 @@ const KEY_2 = 50;
  selector: '[mention], [mentionConfig]',
  selector: '[mention], [mentionConfig]',
  host: {
  host: {
    '(keydown)': 'keyHandler($event)',
    '(keydown)': 'keyHandler($event)',
    '(blur)': 'blurHandler($event)'
    '(blur)': 'blurHandler($event)',
    'autocomplete': 'off'
  }
  }
})
})
export class MentionDirective implements OnChanges {
export class MentionDirective implements OnChanges {
@@ -213,10 +214,10 @@ export class MentionDirective implements OnChanges {
          if (event.keyCode === KEY_TAB || event.keyCode === KEY_ENTER) {
          if (event.keyCode === KEY_TAB || event.keyCode === KEY_ENTER) {
            this.stopEvent(event);
            this.stopEvent(event);
            this.searchList.hidden = true;
            this.searchList.hidden = true;
            const text = this.activeConfig.mentionSelect(this.searchList.activeItem);
            // value is inserted without a trailing space for consistency
            // value is inserted without a trailing space for consistency
            // between element types (div and iframe do not preserve the space)
            // between element types (div and iframe do not preserve the space)
            insertValue(nativeElement, this.startPos, pos,
            insertValue(nativeElement, this.startPos, pos, text, this.iframe);
              this.activeConfig.mentionSelect(this.searchList.activeItem), this.iframe);
            // fire input event so angular bindings are updated
            // fire input event so angular bindings are updated
            if ("createEvent" in document) {
            if ("createEvent" in document) {
              var evt = document.createEvent("HTMLEvents");
              var evt = document.createEvent("HTMLEvents");