Fix browser incrmenting numberInput by itself while scrolling

Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
Florian Bouillon 2019-12-10 10:14:21 +01:00
parent 753675b15c
commit 854c5fae1e
No known key found for this signature in database
GPG Key ID: B143FF27EF555D16

View File

@ -19,6 +19,10 @@ export default class NumberInput extends DefaultInput {
}
})
// Desactivate Wheel Event
element.addEventListener("wheel", (e: WheelEvent) => {
if (document.activeElement === this.element) e.preventDefault()
})
}
public formatValue(value: any): number|undefined {