We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a5622f5 commit 522f084Copy full SHA for 522f084
1 file changed
src/components/pg/inputNumber/inputNumber.ts
@@ -26,6 +26,16 @@ export default class PgInputNumber extends HTMLElement {
26
connectedCallback() {
27
this.$input.addEventListener('input', this.handleInput.bind(this));
28
this.$input.addEventListener('change', this.handleChange.bind(this));
29
+ this.$input.addEventListener('beforeinput', (e: KeyboardEvent) => {
30
+ switch (e.key) {
31
+ case 'ArrowUp':
32
+ this.#triggerInput(this.value + this.step);
33
+ break;
34
+ case 'ArrowDown':
35
+ this.#triggerInput(this.value - this.step);
36
37
+ }
38
+ });
39
this.$buttonMinus.addEventListener('increment', (e: any) => {
40
this.#triggerInput(this.value - this.step);
41
});
0 commit comments