diff --git a/app/assets/javascripts/discourse/views/user-card.js.es6 b/app/assets/javascripts/discourse/views/user-card.js.es6 index 4d009c82c85..6fb1aa5dc6f 100644 --- a/app/assets/javascripts/discourse/views/user-card.js.es6 +++ b/app/assets/javascripts/discourse/views/user-card.js.es6 @@ -1,5 +1,7 @@ import CleansUp from 'discourse/mixins/cleans-up'; +import afterTransition from 'discourse/lib/after-transition'; + var clickOutsideEventName = "mousedown.outside-user-card", clickDataExpand = "click.discourse-user-card", clickMention = "click.discourse-user-mention"; @@ -27,6 +29,12 @@ export default Discourse.View.extend(CleansUp, { _setup: function() { var self = this; + afterTransition(self.$(), function() { + if (!self.get('controller.visible')) { + self.$().css({ left: -9999, top: -9999 }); + } + }); + $('html').off(clickOutsideEventName).on(clickOutsideEventName, function(e) { if (self.get('controller.visible')) { var $target = $(e.target);