mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 01:01:55 +01:00
Only prevent scrolling while editing
This commit is contained in:
parent
74aebd32a7
commit
50ee690717
1 changed files with 6 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue