How to use the keycode.codes.up function in keycode

To help you get started, we’ve selected a few keycode examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wix-playground / stylable-components / test / components / number-input.spec.tsx View on Github external
await waitForDom(() => {
                    const input = select('NATIVE_INPUT_NUMBER');

                    simulate.keyDown(input, {keyCode: KeyCodes.up});

                    assertCommit(input, onChange, max);
                });
            });
github wix-playground / stylable-components / test / components / number-input.spec.tsx View on Github external
await waitForDom(() => {
                    const input = select('NATIVE_INPUT_NUMBER');

                    simulate.keyDown(input, {keyCode: KeyCodes.up});

                    assertCommit(input, onChange, value + step);
                });
            });
github wix-playground / stylable-components / test-kit / components / number-input-driver.ts View on Github external
public pressUpKey(opts?: Modifiers) {
        simulate.keyDown(this.nativeInput, {keyCode: KeyCodes.up, ...opts});
    }
github wix-playground / stylable-components / src / components / number-input / number-input.tsx View on Github external
private handleInputKeyDown: React.KeyboardEventHandler = e => {
        switch (e.keyCode) {
            case KeyCodes.up:
                this.stepValue(Direction.Increase, e.shiftKey ? 10 : 1);
                e.preventDefault();
                break;
            case KeyCodes.down:
                this.stepValue(Direction.Decrease, e.shiftKey ? 10 : 1);
                e.preventDefault();
                break;
            case KeyCodes.enter:
                this.commit(this.state.value);
                e.preventDefault();
                break;
            case KeyCodes.esc:
                this.revert();
                e.preventDefault();
                break;
        }

keycode

Convert between keyboard keycodes and keynames and vice versa.

MIT
Latest version published 3 years ago

Package Health Score

70 / 100
Full package analysis