Skip to content

Commit

Permalink
Fix editing time using wheel changes volume
Browse files Browse the repository at this point in the history
  • Loading branch information
hanydd committed Sep 13, 2024
1 parent deebb35 commit 1f012b8
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/components/SponsorTimeEditComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,9 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
});

// Prevent scrolling while changing times
document.getElementById("sponsorTimesContainer" + this.idSuffix).addEventListener(
"wheel",
(e) => {
if (this.state.editing) {
e.preventDefault();
}
},
{ passive: false }
);
document
.getElementById("sponsorTimesContainer" + this.idSuffix)
.addEventListener("wheel", (e) => e.preventDefault());

// Add as a config listener
if (!this.configUpdateListener) {
Expand Down Expand Up @@ -359,6 +353,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
}

changeTimesWhenScrolling(index: number, e: React.WheelEvent, sponsorTime: SponsorTime): void {
e.stopPropagation();
if (!Config.config.allowScrollingToEdit) return;
let step = 0;
// shift + ctrl = 1
Expand Down

0 comments on commit 1f012b8

Please sign in to comment.