Hide autocompleter suggestions on message submit

This adds a call to `MessageComposer.hideSuggestions()` in the
`onMessageSubmit` function so that the autocompleter is always closed after a
message is sent.

To Reproduce
------------------

On master, create a message like ":D" and send the message. This will trigger
the autocompleter to show up and suggest emojis, but after the message is sent,
the autocompleter will still be visible.

On this branch, sending the same message will close the autocompleter after the
message is sent.

Fix #1203
This commit is contained in:
Chris Opperwall 2016-08-12 17:18:33 -07:00
parent 3f304448cb
commit 67f4f933eb

View File

@ -1557,6 +1557,8 @@ angular.module('myApp.directives', ['myApp.filters'])
$(submitBtn).on('mousedown touchstart', onMessageSubmit) $(submitBtn).on('mousedown touchstart', onMessageSubmit)
function onMessageSubmit (e) { function onMessageSubmit (e) {
var self = this
$timeout(function () { $timeout(function () {
updateValue() updateValue()
$scope.draftMessage.send() $scope.draftMessage.send()
@ -1564,6 +1566,8 @@ angular.module('myApp.directives', ['myApp.filters'])
if (composerEmojiPanel) { if (composerEmojiPanel) {
composerEmojiPanel.update() composerEmojiPanel.update()
} }
self.hideSuggestions()
}, shouldFocusOnInteraction ? 0 : 100) }, shouldFocusOnInteraction ? 0 : 100)
return cancelEvent(e) return cancelEvent(e)
} }