summaryrefslogtreecommitdiffstats
path: root/webapp/components/suggestion
diff options
context:
space:
mode:
authorAsaad Mahmood <asaadmahmoodspin@users.noreply.github.com>2016-06-09 23:09:35 +0500
committerCorey Hulen <corey@hulen.com>2016-06-09 11:09:35 -0700
commitf1eefd99e6e40621ace005afcb1c08c6a69a744e (patch)
tree662e87be9abb5a6af84b04b04f5b8ae60de1508e /webapp/components/suggestion
parentd52bd0f6dc446373da56585ff91a1c02d4dd7d00 (diff)
downloadchat-f1eefd99e6e40621ace005afcb1c08c6a69a744e.tar.gz
chat-f1eefd99e6e40621ace005afcb1c08c6a69a744e.tar.bz2
chat-f1eefd99e6e40621ace005afcb1c08c6a69a744e.zip
PLT-3094 - Fixing autocomplete and image modal scrolling on mobile (#3279)
Diffstat (limited to 'webapp/components/suggestion')
-rw-r--r--webapp/components/suggestion/suggestion_box.jsx9
-rw-r--r--webapp/components/suggestion/suggestion_list.jsx1
2 files changed, 8 insertions, 2 deletions
diff --git a/webapp/components/suggestion/suggestion_box.jsx b/webapp/components/suggestion/suggestion_box.jsx
index 6260e179c..2184b9fab 100644
--- a/webapp/components/suggestion/suggestion_box.jsx
+++ b/webapp/components/suggestion/suggestion_box.jsx
@@ -31,7 +31,7 @@ export default class SuggestionBox extends React.Component {
}
componentDidMount() {
- $(document).on('click', this.handleDocumentClick);
+ $(document).on('click touchstart', this.handleDocumentClick);
SuggestionStore.addCompleteWordListener(this.suggestionId, this.handleCompleteWord);
SuggestionStore.addPretextChangedListener(this.suggestionId, this.handlePretextChanged);
@@ -42,7 +42,7 @@ export default class SuggestionBox extends React.Component {
SuggestionStore.removePretextChangedListener(this.suggestionId, this.handlePretextChanged);
SuggestionStore.unregisterSuggestionBox(this.suggestionId);
- $(document).off('click', this.handleDocumentClick);
+ $(document).off('click touchstart', this.handleDocumentClick);
}
getTextbox() {
@@ -58,6 +58,11 @@ export default class SuggestionBox extends React.Component {
handleDocumentClick(e) {
const container = $(ReactDOM.findDOMNode(this));
+ if ($('.suggestion-list__content').length) {
+ if (!($(e.target).hasClass('suggestion-list__content') || $(e.target).parents().hasClass('suggestion-list__content'))) {
+ $('body').removeClass('modal-open');
+ }
+ }
if (!(container.is(e.target) || container.has(e.target).length > 0)) {
// we can't just use blur for this because it fires and hides the children before
// their click handlers can be called
diff --git a/webapp/components/suggestion/suggestion_list.jsx b/webapp/components/suggestion/suggestion_list.jsx
index 134e7a8d4..f1cccf8aa 100644
--- a/webapp/components/suggestion/suggestion_list.jsx
+++ b/webapp/components/suggestion/suggestion_list.jsx
@@ -51,6 +51,7 @@ export default class SuggestionList extends React.Component {
}
getContent() {
+ $('body').addClass('modal-open');
return $(ReactDOM.findDOMNode(this.refs.content));
}