From 50ee69071794ce4d9da0f0b8531e47d9a67b2e5f Mon Sep 17 00:00:00 2001 From: Ajay Date: Sun, 21 Jan 2024 13:37:29 -0500 Subject: [PATCH] Only prevent scrolling while editing --- src/components/SponsorTimeEditComponent.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx index 7f30f0cc..4c8b1641 100644 --- a/src/components/SponsorTimeEditComponent.tsx +++ b/src/components/SponsorTimeEditComponent.tsx @@ -81,13 +81,15 @@ class SponsorTimeEditComponent extends React.Component { + e.stopPropagation(); }); // Prevent scrolling while changing times - document.getElementById("sponsorTimesContainer" + this.idSuffix).addEventListener('wheel', function (event) { - event.preventDefault(); + document.getElementById("sponsorTimesContainer" + this.idSuffix).addEventListener('wheel', (e) => { + if (this.state.editing) { + e.preventDefault(); + } }, {passive: false}); // Add as a config listener