summaryrefslogtreecommitdiffstats
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
parentd52bd0f6dc446373da56585ff91a1c02d4dd7d00 (diff)
downloadchat-f1eefd99e6e40621ace005afcb1c08c6a69a744e.tar.gz
chat-f1eefd99e6e40621ace005afcb1c08c6a69a744e.tar.bz2
chat-f1eefd99e6e40621ace005afcb1c08c6a69a744e.zip
PLT-3094 - Fixing autocomplete and image modal scrolling on mobile (#3279)
-rw-r--r--webapp/components/suggestion/suggestion_box.jsx9
-rw-r--r--webapp/components/suggestion/suggestion_list.jsx1
-rw-r--r--webapp/sass/layout/_post.scss4
-rw-r--r--webapp/sass/responsive/_mobile.scss8
4 files changed, 16 insertions, 6 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));
}
diff --git a/webapp/sass/layout/_post.scss b/webapp/sass/layout/_post.scss
index 938f4bde6..db64d739e 100644
--- a/webapp/sass/layout/_post.scss
+++ b/webapp/sass/layout/_post.scss
@@ -258,10 +258,6 @@ body.ios {
position: absolute;
width: 100%;
- .modal-open & {
- @include clearfix;
- }
-
&.active {
display: inline;
}
diff --git a/webapp/sass/responsive/_mobile.scss b/webapp/sass/responsive/_mobile.scss
index d4c7242b4..eec08b1e5 100644
--- a/webapp/sass/responsive/_mobile.scss
+++ b/webapp/sass/responsive/_mobile.scss
@@ -1,6 +1,14 @@
@charset 'UTF-8';
@media screen and (max-width: 768px) {
+ #post-list {
+ .post-list-holder-by-time {
+ .modal-open & {
+ @include clearfix;
+ }
+ }
+ }
+
.post-code__language {
@include opacity(.6);
@include transition(none);