From 809cc9f6f36a4b196885cd78572ff026c06cd0ae Mon Sep 17 00:00:00 2001 From: hmhealey Date: Tue, 7 Jul 2015 17:44:32 -0400 Subject: Changed code to dismiss mention list to not trigger when you click on the list itself --- web/react/components/mention_list.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'web') 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"}) } }); -- cgit v1.2.3-1-g7c22