How to use the @uifabric/utilities.KeyCodes.enter function in @uifabric/utilities

To help you get started, we’ve selected a few @uifabric/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 OfficeDev / office-ui-fabric-react / packages / date-time / src / components / DatePicker / DatePicker.base.tsx View on Github external
private _onTextFieldKeyDown = (ev: React.KeyboardEvent): void => {
    switch (ev.which) {
      case KeyCodes.enter:
        ev.preventDefault();
        ev.stopPropagation();
        if (!this.state.isDatePickerShown) {
          this._validateTextInput();
          this._showDatePickerPopup();
        } else {
          // When DatePicker allows input date string directly,
          // it is expected to hit another enter to close the popup
          if (this.props.allowTextInput) {
            this._dismissDatePickerPopup();
          }
        }
        break;

      case KeyCodes.escape:
        this._handleEscKey(ev);
github OfficeDev / office-ui-fabric-react / packages / date-time / src / components / CalendarDayGrid / CalendarDayGrid.base.tsx View on Github external
return (ev: React.KeyboardEvent): void => {
      if (ev.which === KeyCodes.enter) {
        this._onSelectDate(originalDate);
      } else {
        this._navigateMonthEdge(ev, originalDate, weekIndex, dayIndex);
      }
    };
  };
github OfficeDev / office-ui-fabric-react / packages / date-time / src / components / Calendar / CalendarDay / CalendarDay.base.tsx View on Github external
return (ev: React.KeyboardEvent) => {
      switch (ev.which) {
        case KeyCodes.enter:
          callback();
          break;
      }
    };
  };
github OfficeDev / office-ui-fabric-react / packages / date-time / src / components / Calendar / Calendar.base.tsx View on Github external
return (ev: React.KeyboardEvent) => {
      switch (ev.which) {
        case KeyCodes.enter:
        case KeyCodes.space:
          callback();
          break;
      }
    };
  };
github microsoft / fluent-ui-react / src / components / FocusZone / FocusZone.tsx View on Github external
this._root.current && (this._root.current.lastChild as HTMLElement | null)
          if (
            this._root.current &&
            this.focusElement(getPreviousElement(
              this._root.current,
              lastChild,
              true,
              true,
              true,
            ) as HTMLElement)
          ) {
            break
          }
          return

        case KeyCodes.enter:
          if (this.tryInvokeClickForFocusable(ev.target as HTMLElement)) {
            break
          }
          return

        default:
          return
      }
    }

    ev.preventDefault()
    ev.stopPropagation()
  }
github OfficeDev / office-ui-fabric-react / packages / date-time / src / components / Calendar / CalendarMonth / CalendarMonth.base.tsx View on Github external
return (ev: React.KeyboardEvent) => {
      switch (ev.which) {
        case KeyCodes.enter:
          callback();
          break;
      }
    };
  };
github OfficeDev / office-ui-fabric-react / packages / date-time / src / components / WeeklyDayPicker / WeeklyDayPicker.base.tsx View on Github external
return (ev: React.KeyboardEvent) => {
      switch (ev.which) {
        case KeyCodes.enter:
          callback();
          break;
      }
    };
  };