Make chat scrolling events passive

c684d23476f20130e8d2996cb13fd60d5afc1dc7

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +9 -6Ignore whitespace
public/script.js+9 -6
@@ -9126,10 +9126,6 @@ jQuery(async function () {
9126 $('#groupCurrentMemberListToggle .inline-drawer-icon').trigger('click');9126 $('#groupCurrentMemberListToggle .inline-drawer-icon').trigger('click');
9127 }, 200);9127 }, 200);
91289128
9129 $('#chat').on('wheel touchstart', () => {
9130 scrollLock = true;
9131 });
9132
9133 $(document).on('click', '.api_loading', cancelStatusCheck);9129 $(document).on('click', '.api_loading', cancelStatusCheck);
91349130
9135 //////////INPUT BAR FOCUS-KEEPING LOGIC/////////////9131 //////////INPUT BAR FOCUS-KEEPING LOGIC/////////////
@@ -9247,12 +9243,19 @@ jQuery(async function () {
9247 immediately ? autoFitEditTextArea(e.target) : autoFitEditTextAreaDebounced(e.target);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 if (is_use_scroll_holder) {9254 if (is_use_scroll_holder) {
9252 this.scrollTop = scroll_holder;9255 this.scrollTop = scroll_holder;
9253 is_use_scroll_holder = false;9256 is_use_scroll_holder = false;
9254 }9257 }
9255 });9258 }, { passive: true });
92569259
9257 $(document).on('click', '.mes', function () {9260 $(document).on('click', '.mes', function () {
9258 //when a 'delete message' parent div is clicked9261 //when a 'delete message' parent div is clicked