How to use the @microsoft/fast-web-utilities.KeyCodes.tab function in @microsoft/fast-web-utilities

To help you get started, we’ve selected a few @microsoft/fast-web-utilities 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 microsoft / fast-dna / packages / fast-tooling-react / src / css-property-editor / property-editor.tsx View on Github external
): void => {
        const rowCount: number = Object.keys(this.editData).length;
        switch (event.keyCode) {
            case KeyCodes.enter:
                if (rowIndex < rowCount - 1) {
                    // focus on the next row
                    this.focusOnRow(rowIndex + 1);
                    event.preventDefault();
                } else if (this.editData[rowKey] !== "") {
                    // create a new row if the current one is valid
                    this.createRow(rowCount);
                    event.preventDefault();
                }
                return;

            case KeyCodes.tab:
                if (
                    !event.shiftKey &&
                    rowIndex === rowCount - 1 &&
                    this.editData[rowKey] !== ""
                ) {
                    // create a new row if the current one is valid
                    this.createRow(rowCount);
                    event.preventDefault();
                }
                return;
        }
    };
github microsoft / fast-dna / packages / fast-form-generator-react / src / form / form-item.children.tsx View on Github external
private handleChildrenListInputKeydown = (
        e: React.KeyboardEvent
    ): void => {
        switch (e.keyCode) {
            case KeyCodes.enter:
                e.preventDefault();
            case KeyCodes.tab:
                if (this.state.childrenSearchTerm !== "") {
                    this.onAddComponent(
                        this.state.filteredChildOptions[
                            this.state.indexOfSelectedFilteredChildOption
                        ]
                    );
                }

                this.setState({
                    hideChildrenList: true,
                });
                break;
            case KeyCodes.arrowUp:
                this.selectPreviousFilteredChildOption();
                break;
            case KeyCodes.arrowDown: