Only prevent scrolling while editing

This commit is contained in:
Ajay 2024-01-21 13:37:29 -05:00
parent 74aebd32a7
commit 50ee690717

View file

@ -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