<commit_before>import React, { Component } from 'react';
import Tag from './Tag';
import Suggestions from './Suggestions';

// Constants
const Keys = {
  ENTER: 13,
  TAB: 9,
  BACKSPACE: 8,
  UP_ARROW: 38,
  DOWN_ARROW: 40,
  ESCAPE: 27
};

class ReactTagSelect extends Component {
  static propTypes = {
    tags: React.PropTypes.array,
    placeholder: React.PropTypes.string,
    labelField: React.PropTypes.string,
    suggestions: React.PropTypes.array,
    delimeters: React.PropTypes.array,
    autofocus: React.PropTypes.bool,
    handleDelete: React.PropTypes.func.isRequired,
    handleAddition: React.PropTypes.func.isRequired,
    allowDeleteFromEmptyInput: React.PropTypes.bool,
    handleInputChange: React.PropTypes.func,
    minQueryLength: React.PropTypes.number,
    removeComponent: React.PropTypes.func,
    autocomplete: React.PropTypes.oneOfType([
      React.PropTypes.bool,
      React.PropTypes.number
    ]),
    readOnly: React.PropTypes.bool,
  }
  static defaultProps = {
    placeholder: 'Add new tag',
    tags: [],
    suggestions: [],
    delimeters: [Keys.ENTER, Keys.TAB],
    autofocus: true,
    allowDeleteFromEmptyInput: true,
    minQueryLength: 2,
    autocomplete: false,
    readOnly: false
  }
  constructor(props) {
    super(props);
    this.state = {
      suggestions: this.props.suggestions,
      query: '',
      selectedIndex: -1,
      selectionMode: false
    };
  }
  componentDidMount() {
    if (this.props.autofocus) {<commit_msg>make autofocus false by default ;<commit_after>import React, { Component } from 'react';
import Tag from './Tag';
import Suggestions from './Suggestions';

// Constants
const Keys = {
  ENTER: 13,
  TAB: 9,
  BACKSPACE: 8,
  UP_ARROW: 38,
  DOWN_ARROW: 40,
  ESCAPE: 27
};

class ReactTagSelect extends Component {
  static propTypes = {
    tags: React.PropTypes.array,
    placeholder: React.PropTypes.string,
    labelField: React.PropTypes.string,
    suggestions: React.PropTypes.array,
    delimeters: React.PropTypes.array,
    autofocus: React.PropTypes.bool,
    handleDelete: React.PropTypes.func.isRequired,
    handleAddition: React.PropTypes.func.isRequired,
    allowDeleteFromEmptyInput: React.PropTypes.bool,
    handleInputChange: React.PropTypes.func,
    minQueryLength: React.PropTypes.number,
    removeComponent: React.PropTypes.func,
    autocomplete: React.PropTypes.oneOfType([
      React.PropTypes.bool,
      React.PropTypes.number
    ]),
    readOnly: React.PropTypes.bool,
  }
  static defaultProps = {
    placeholder: 'Add new tag',
    tags: [],
    suggestions: [],
    delimeters: [Keys.ENTER, Keys.TAB],
    autofocus: false,
    allowDeleteFromEmptyInput: true,
    minQueryLength: 2,
    autocomplete: false,
    readOnly: false
  }
  constructor(props) {
    super(props);
    this.state = {
      suggestions: this.props.suggestions,
      query: '',
      selectedIndex: -1,
      selectionMode: false
    };
  }
  componentDidMount() {
    if (this.props.autofocus) {
{'fraction_non_alphanumeric': 0.11370456818939646, 'fraction_numerical': 0.008002667555851951, 'mean_word_length': 3.310344827586207, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5178401', 'n_tokens_mistral': 996, 'n_tokens_neox': 953, 'n_words': 201}