Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
fix(TCMention): hide mention panel on editableBlur
Browse files Browse the repository at this point in the history
* Closes #2
  • Loading branch information
tomchentw committed Nov 3, 2015
1 parent 5a7be44 commit 65f007b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const TCMention = MediumEditor.Extension.extend({
this.getEditorOption(`elementsContainer`).appendChild(this.mentionPanel);

this.subscribe(`editableKeydown`, ::this.handleKeydown);
this.subscribe(`editableBlur`, ::this.handleBlur);
//
// instance variables
this.trigger = null;
Expand Down Expand Up @@ -157,6 +158,10 @@ Your mention implementation
}
},

handleBlur (event) {
this.hidePanel();
},

handleTriggerKeydown (trigger, event) {
this.trigger = trigger;
this.triggerClassName = this.triggerClassNameMap[this.trigger];
Expand Down

0 comments on commit 65f007b

Please sign in to comment.