Im using this code but it allows characters too. I only want the div to accept numeric value while function keys should work on it as well.
this.shadowRoot.querySelector('div').addEventListener('keydown', async (e) => {
if (e.keyCode >= 65 && e.keyCode <= 90) {
e.preventDefault();
return false;
}
});