diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2015-07-07 17:44:32 -0400 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2015-07-07 17:44:32 -0400 |
commit | 809cc9f6f36a4b196885cd78572ff026c06cd0ae (patch) | |
tree | 9377a4cb4a1bcc396a09b283ac1ffce997977909 /web | |
parent | 66e97a56b0814b7c2378e9c7b4603d1c6408d330 (diff) | |
download | chat-809cc9f6f36a4b196885cd78572ff026c06cd0ae.tar.gz chat-809cc9f6f36a4b196885cd78572ff026c06cd0ae.tar.bz2 chat-809cc9f6f36a4b196885cd78572ff026c06cd0ae.zip |
Changed code to dismiss mention list to not trigger when you click on the list itself
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/mention_list.jsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/web/react/components/mention_list.jsx b/web/react/components/mention_list.jsx index b666fcfae..3fac41073 100644 --- a/web/react/components/mention_list.jsx +++ b/web/react/components/mention_list.jsx @@ -23,8 +23,9 @@ module.exports = React.createClass({ } } ); - $(document).click(function() { - if($('#'+self.props.id).length && $('#'+self.props.id).get(0) !== $(':focus').get(0)) { + $(document).click(function(e) { + if (!($('#'+self.props.id).is(e.target) || $('#'+self.props.id).has(e.target).length || + ('mentionlist' in self.refs && $(self.refs['mentionlist'].getDOMNode()).has(e.target).length))) { self.setState({mentionText: "-1"}) } }); |