<commit_before>import * as React from 'react';
import {Typeahead} from 'react-bootstrap-typeahead'; // ES2015
import {gql} from 'apollo-boost';
import { Query } from 'react-apollo';
import {SuggestionsQuery} from 'types/SuggestionsQuery';
import {path, pathOr, test, is, map} from 'ramda';

const QUERY = gql`
  query SuggestionsQuery {
    autosuggest {
      word
      frequency
    }
  }
`;

class AutoSuggester extends React.Component {
	eachPath = (array_data) => {
		return path(['word'], array_data);
	};

	render() {
		const defaultOptions = ['Jick', 'Miles', 'Charles', 'Herbie'];
		return (
      <Query query={QUERY}>
        {({ data, loading, error }) => {
        	if (error) {
				return null;
			}
			if (loading) {
				return "Loading ..."
			}
			let wordList: [] | null | undefined | any = null;
			if (data && !loading) {
				let autoSuggestData: any = path(['autosuggest'], data);
				//wordList = map(this.eachPath, path(['autosuggest'], data));
				wordList = map(this.eachPath, autoSuggestData);

			}
			return (
			<Typeahead {...this.props} options={defaultOptions} minLength={2}/>
				);
		}}
      </Query>
    );
		
	}
}

export default AutoSuggester;<commit_msg>menu only pops when user starts typing now (before would pop up when input was clicked on<commit_after>import * as React from 'react';
import {Typeahead} from 'react-bootstrap-typeahead'; // ES2015
import {gql} from 'apollo-boost';
import { Query } from 'react-apollo';
import {SuggestionsQuery} from 'types/SuggestionsQuery';
import {path, pathOr, test, is, map} from 'ramda';

const QUERY = gql`
  query SuggestionsQuery {
    autosuggest {
      word
      frequency
    }
  }
`;

class AutoSuggester extends React.Component {
	eachPath = (array_data) => {
		return path(['word'], array_data);
	};

	render() {
		const defaultOptions = ['Jick', 'Miles', 'Charles', 'Herbie'];
		return (
      <Query query={QUERY}>
        {({ data, loading, error }) => {
        	if (error) {
				return null;
			}
			if (loading) {
				return "Loading ..."
			}
			let wordList: [] | null | undefined | any = null;
			if (data && !loading) {
				let autoSuggestData: any = path(['autosuggest'], data);
				//wordList = map(this.eachPath, path(['autosuggest'], data));
				wordList = map(this.eachPath, autoSuggestData);

			}
			return (
			<Typeahead {...this.props} options={wordList} minLength={1}/>
				);
		}}
      </Query>
    );
		
	}
}

export default AutoSuggester;
{'fraction_non_alphanumeric': 0.15581773799837267, 'fraction_numerical': 0.0040683482506102524, 'mean_word_length': 3.1607445008460235, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2009500', 'n_tokens_mistral': 913, 'n_tokens_neox': 796, 'n_words': 211}