mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 20:47:11 +03:00
Only prevent scrolling while editing
This commit is contained in:
@@ -81,13 +81,15 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
|||||||
|
|
||||||
componentDidMount(): void {
|
componentDidMount(): void {
|
||||||
// Prevent inputs from triggering key events
|
// Prevent inputs from triggering key events
|
||||||
document.getElementById("sponsorTimeEditContainer" + this.idSuffix).addEventListener('keydown', function (event) {
|
document.getElementById("sponsorTimeEditContainer" + this.idSuffix).addEventListener('keydown', (e) => {
|
||||||
event.stopPropagation();
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Prevent scrolling while changing times
|
// Prevent scrolling while changing times
|
||||||
document.getElementById("sponsorTimesContainer" + this.idSuffix).addEventListener('wheel', function (event) {
|
document.getElementById("sponsorTimesContainer" + this.idSuffix).addEventListener('wheel', (e) => {
|
||||||
event.preventDefault();
|
if (this.state.editing) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
}, {passive: false});
|
}, {passive: false});
|
||||||
|
|
||||||
// Add as a config listener
|
// Add as a config listener
|
||||||
|
|||||||
Reference in New Issue
Block a user