PLT-4459 Fixed not being able to scroll on mobile after autocomplete is shown (#4464)
* Fixed not being able to scroll on mobile after autocomplete is shown * Fixed SuggestionLists not being scrollable on iOS
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
18745b2d5c
Коммит
428444d185
@@ -31,7 +31,7 @@ export default class SuggestionBox extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
$(document).on('click touchstart', this.handleDocumentClick);
|
$(document).on('click', this.handleDocumentClick);
|
||||||
|
|
||||||
SuggestionStore.addCompleteWordListener(this.suggestionId, this.handleCompleteWord);
|
SuggestionStore.addCompleteWordListener(this.suggestionId, this.handleCompleteWord);
|
||||||
SuggestionStore.addPretextChangedListener(this.suggestionId, this.handlePretextChanged);
|
SuggestionStore.addPretextChangedListener(this.suggestionId, this.handlePretextChanged);
|
||||||
@@ -42,7 +42,7 @@ export default class SuggestionBox extends React.Component {
|
|||||||
SuggestionStore.removePretextChangedListener(this.suggestionId, this.handlePretextChanged);
|
SuggestionStore.removePretextChangedListener(this.suggestionId, this.handlePretextChanged);
|
||||||
|
|
||||||
SuggestionStore.unregisterSuggestionBox(this.suggestionId);
|
SuggestionStore.unregisterSuggestionBox(this.suggestionId);
|
||||||
$(document).off('click touchstart', this.handleDocumentClick);
|
$(document).off('click', this.handleDocumentClick);
|
||||||
}
|
}
|
||||||
|
|
||||||
getTextbox() {
|
getTextbox() {
|
||||||
@@ -60,14 +60,14 @@ export default class SuggestionBox extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleDocumentClick(e) {
|
handleDocumentClick(e) {
|
||||||
const container = $(ReactDOM.findDOMNode(this));
|
if (!SuggestionStore.hasSuggestions(this.suggestionId)) {
|
||||||
if ($('.suggestion-list__content').length) {
|
return;
|
||||||
if (!($(e.target).hasClass('suggestion-list__content') || $(e.target).parents().hasClass('suggestion-list__content'))) {
|
|
||||||
$('body').removeClass('modal-open');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const container = $(ReactDOM.findDOMNode(this));
|
||||||
|
|
||||||
if (!(container.is(e.target) || container.has(e.target).length > 0)) {
|
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
|
// We can't just use blur for this because it fires and hides the children before
|
||||||
// their click handlers can be called
|
// their click handlers can be called
|
||||||
GlobalActions.emitClearSuggestions(this.suggestionId);
|
GlobalActions.emitClearSuggestions(this.suggestionId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ export default class SuggestionList extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getContent() {
|
getContent() {
|
||||||
$('body').addClass('modal-open');
|
|
||||||
return $(ReactDOM.findDOMNode(this.refs.content));
|
return $(ReactDOM.findDOMNode(this.refs.content));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,7 @@
|
|||||||
.popover-content {
|
.popover-content {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
padding-bottom: 5px;
|
padding-bottom: 5px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
|
||||||
.command {
|
.command {
|
||||||
border-bottom: 1px solid $light-gray;
|
border-bottom: 1px solid $light-gray;
|
||||||
|
|||||||
@@ -107,14 +107,6 @@
|
|||||||
margin-right: 0 !important;
|
margin-right: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#post-list {
|
|
||||||
.post-list-holder-by-time {
|
|
||||||
.modal-open & {
|
|
||||||
@include clearfix;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-code__language {
|
.post-code__language {
|
||||||
@include opacity(.6);
|
@include opacity(.6);
|
||||||
@include transition(none);
|
@include transition(none);
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user