Skip to content

Commit

Permalink
MM 17278 - Stop posts lists from scrolling when the emoji picker is o…
Browse files Browse the repository at this point in the history
…pen (mattermost#3860)

* prevent scrolling while emoji picker is open

- easier of potential approaches

* stop RHS posts from scrolling

* update to prevent tests from failing

* this time using `remove`
  • Loading branch information
deanwhillier authored Oct 30, 2019
1 parent 1d2bcff commit 33ce190
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions components/emoji_picker/emoji_picker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ export default class EmojiPicker extends React.PureComponent {
if (this.emojiPickerContainer) {
this.divHeight = this.emojiPickerContainer.offsetHeight;
}

const rootComponent = document.getElementById('root');
if (rootComponent) {
rootComponent.classList.add('emoji-picker--active');
}
}

updateEmojisToShow(divTopOffset) {
Expand All @@ -266,6 +271,11 @@ export default class EmojiPicker extends React.PureComponent {
if (this.renderAllCategoriesFrame) {
window.cancelAnimationFrame(this.renderAllCategoriesFrame);
}

const rootComponent = document.getElementById('root');
if (rootComponent) {
rootComponent.classList.remove('emoji-picker--active');
}
}

renderAllCategories = () => {
Expand Down
4 changes: 4 additions & 0 deletions sass/layout/_post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2105,4 +2105,8 @@
margin-bottom: 1em;
margin-top: -1em;
}

.emoji-picker--active & {
pointer-events: none;
}
}
6 changes: 6 additions & 0 deletions sass/layout/_sidebar-right.scss
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@
.info-card {
padding: 5px 15px 60px 15px;
}

.scrollbar--view {
.emoji-picker--active & {
pointer-events: none;
}
}
}

.sidebar__overlay {
Expand Down

0 comments on commit 33ce190

Please sign in to comment.