<commit_before>'use strict'
import React from 'react'
import PropTypes from 'prop-types'
import Select from 'react-select'

export default class Tags extends React.Component {
  constructor(props) {
    super(props)
    this.newOptionClick = this.newOptionClick.bind(this)
  }

  newOptionClick(value) {
    this.props.newOptionClick(value)
    this.refs.tagSelect.select.setState({inputValue: ''})
  }

  render() {
    return (
      <div>
        <Select.Creatable
          ref="tagSelect"
          multi={true}
          options={this.props.tags}
          value={this.props.entryTags}
          onNewOptionClick={this.newOptionClick}
          onChange={this.props.tagChange}/>
      </div>
    )
  }
}

Tags.propTypes = {
  tags: PropTypes.array,
  entryTags: PropTypes.array,
  tagChange: PropTypes.func,
  newOptionClick: PropTypes.func
}
<commit_msg>Tags are forced to lowercase.<commit_after>'use strict'
import React from 'react'
import PropTypes from 'prop-types'
import Select from 'react-select'

export default class Tags extends React.Component {
  constructor(props) {
    super(props)
    this.newOptionClick = this.newOptionClick.bind(this)
    this.forceInput = this.forceInput.bind(this)
  }

  newOptionClick(value) {
    this.props.newOptionClick(value)
    this.refs.tagSelect.select.setState({inputValue: ''})
  }

  forceInput(val) {
    const toLower = val.toLowerCase()
    return toLower
  }

  render() {
    return (
      <div>
        <Select.Creatable
          ref="tagSelect"
          multi={true}
          options={this.props.tags}
          value={this.props.entryTags}
          onNewOptionClick={this.newOptionClick}
          onInputChange={this.forceInput}
          ignoreCase={true}
          onChange={this.props.tagChange}/>
      </div>
    )
  }
}

Tags.propTypes = {
  tags: PropTypes.array,
  entryTags: PropTypes.array,
  tagChange: PropTypes.func,
  newOptionClick: PropTypes.func
}

{'fraction_non_alphanumeric': 0.11655492521918515, 'fraction_numerical': 0.0, 'mean_word_length': 2.911290322580645, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6168537', 'n_tokens_mistral': 599, 'n_tokens_neox': 607, 'n_words': 108}