<commit_before>import React, { Component, PropTypes } from 'react';

class ListBox extends Component {
  constructor(props) {
      super(props);
  }
  componentWillReceiveProps(nextProps) {
    this.props = nextProps;
  }
  selectItem = (e) => {
    e.preventDefault();
  	if (this.props.onItemSelect) {
  		this.props.onItemSelect(e.target.value);
  	}
  }
  isSelectionValid = (level) => {
    if (this.props.selectionlevel) {
      if (this.props.selectionlevel.indexOf(level) > -1) {
        return true
      }
      return false;
    }
    return true;
  }
  getHiglightStyle = (value) => {
    if (this.props.highlightItems && this.props.highlightItems[value]) {
      return this.props.highlightItems[value];<commit_msg>list box selection bugs fixed<commit_after>import React, { Component, PropTypes } from 'react';

class ListBox extends Component {
  constructor(props) {
      super(props);
  }
  componentWillReceiveProps(nextProps) {
    this.props = nextProps;
  }
  selectItem = (e) => {
  	if (this.props.onItemSelect) {
  		this.props.onItemSelect(e.target.value);
  	} else {
      e.preventDefault();
    }
  }
  isSelectionValid = (level) => {
    if (this.props.selectionlevel) {
      if (this.props.selectionlevel.indexOf(level) > -1) {
        return true
      }
      return false;
    }
    return true;
  }
  getHiglightStyle = (value) => {
    if (this.props.highlightItems && this.props.highlightItems[value]) {
      return this.props.highlightItems[value];
{'fraction_non_alphanumeric': 0.13163196776359973, 'fraction_numerical': 0.001343183344526528, 'mean_word_length': 3.0053763440860215, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '3596791', 'n_tokens_mistral': 486, 'n_tokens_neox': 479, 'n_words': 86}