| 9247 | 9243 | immediately ? autoFitEditTextArea(e.target) : autoFitEditTextAreaDebounced(e.target); |
| 9248 | 9244 | } |
| 9249 | 9245 | }); |
| 9250 | | - document.getElementById('chat').addEventListener('scroll', function () { |
| 9246 | + const chatElement = document.getElementById('chat'); |
| 9247 | + chatElement.addEventListener('wheel', function () { |
| 9248 | + scrollLock = true; |
| 9249 | + }, { passive: true }); |
| 9250 | + chatElement.addEventListener('touchstart', function () { |
| 9251 | + scrollLock = true; |
| 9252 | + }, { passive: true }); |
| 9253 | + chatElement.addEventListener('scroll', function () { |
| 9251 | 9254 | if (is_use_scroll_holder) { |
| 9252 | 9255 | this.scrollTop = scroll_holder; |
| 9253 | 9256 | is_use_scroll_holder = false; |
| 9254 | 9257 | } |
| 9255 | | - }); |
| 9258 | + }, { passive: true }); |
| 9256 | 9259 | |
| 9257 | 9260 | $(document).on('click', '.mes', function () { |
| 9258 | 9261 | //when a 'delete message' parent div is clicked |