Example #1
0
    return !!(this.props.searchString && this.state.focus);
  },
  performSearch(options) {
    let searchData = {
      engineName: options.engineName,
      searchString: options.searchString,
      searchPurpose: "d"
    };
    this.props.dispatch(actions.NotifyPerformSearch(searchData));
    this.props.dispatch(actions.NotifyEvent({
      event: "SEARCH",
      page: PAGE_NAME
    }));
  },
  removeFormHistory(suggestion) {
    this.props.dispatch(actions.NotifyRemoveFormHistory(suggestion));
  },
  cycleCurrentEngine(index) {
    this.props.dispatch(actions.NotifyCycleEngine(this.props.engines[index].name));
  },
  handleKeyPress(e) { // eslint-disable-line complexity,max-statements
    // Handle the keyboard navigation of the widget.

    // If the dropdown isn't visible, we don't handle the event.
    if (!this.getDropdownVisible()) {
      return;
    }

    const index = this.state.activeIndex;
    const numEngines = this.props.engines.length;
    const originalSearchString = this.state.searchString;