Skip to content

Commit

Permalink
Fix external menu trigger.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Humphreys committed Aug 23, 2017
1 parent d796200 commit 38c6707
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
8 changes: 6 additions & 2 deletions dist/tribute.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/tribute.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/tribute.min.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/Tribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ class Tribute {
}

this.current.collection = this.collection[collectionIndex || 0]
this.current.externalTrigger = true
this.current.element = element

this.insertTextAtCursor(this.current.collection.trigger)
Expand Down
5 changes: 4 additions & 1 deletion src/TributeEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ class TributeEvents {
}
tribute.selectItemAtIndex(li.getAttribute('data-index'), event)
tribute.hideMenu()
} else if (tribute.current.element) {

// TODO: should fire with externalTrigger and target is outside of menu
} else if (tribute.current.element && !tribute.current.externalTrigger) {
tribute.current.externalTrigger = false
setTimeout(() => tribute.hideMenu())
}
}
Expand Down

0 comments on commit 38c6707

Please sign in to comment.