diff options
author | Ajay <[email protected]> | 2024-01-21 13:37:29 -0500 |
---|---|---|
committer | Ajay <[email protected]> | 2024-01-21 13:37:29 -0500 |
commit | 50ee69071794ce4d9da0f0b8531e47d9a67b2e5f (patch) | |
tree | 5d67db07330c87c2eb641870704d7d15a97d827e /src/components/SponsorTimeEditComponent.tsx | |
parent | 74aebd32a70b1077770e46c0cb48329df8f27657 (diff) | |
download | SponsorBlock-50ee69071794ce4d9da0f0b8531e47d9a67b2e5f.tar.gz SponsorBlock-50ee69071794ce4d9da0f0b8531e47d9a67b2e5f.zip |
Only prevent scrolling while editing
Diffstat (limited to 'src/components/SponsorTimeEditComponent.tsx')
-rw-r--r-- | src/components/SponsorTimeEditComponent.tsx | 10 |
1 files 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<SponsorTimeEditProps, Spo componentDidMount(): void { // Prevent inputs from triggering key events - document.getElementById("sponsorTimeEditContainer" + this.idSuffix).addEventListener('keydown', function (event) { - event.stopPropagation(); + document.getElementById("sponsorTimeEditContainer" + this.idSuffix).addEventListener('keydown', (e) => { + 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 |