<commit_before>import React, {Component, PropTypes} from 'react';
import t from 'tcomb-form';

function renderInput(locals) {

  const onChange = function (event) {
    locals.onChange(event.target.value);
  };

  const triggerRealInputChange = function (event) {
  	locals.onChange(document.getElementById('virtual-keyboard-helper-' + locals.attrs.name).value);
  };

  return <div>
  	<input type="text" label={locals.label} name={locals.attrs.name} value={locals.value} onChange={onChange} style={{display: 'none'}} />
  	<input type="text" id={'virtual-keyboard-helper-' + locals.attrs.name} className="form-control" label={locals.label} onBlur={triggerRealInputChange} />
  </div>;
}

const textboxTemplate = t.form.Form.templates.textbox.clone({ renderInput })

export default class VirtualKeyboardFactory extends t.form.Textbox {

  getTemplate() {
    return textboxTemplate
  }
}<commit_msg>Fix bug with moving up and down<commit_after>import React, {Component, PropTypes} from 'react';
import t from 'tcomb-form';

function renderInput(locals) {

  const onChange = function (event) {
    locals.onChange(event.target.value);
  };

  const triggerRealInputChange = function (event) {
  	locals.onChange(document.getElementById('virtual-keyboard-helper-' + locals.attrs.name).value);
  };

  return <div>
  	<input type="text" label={locals.label} name={locals.attrs.name} value={locals.value} onChange={onChange} style={{display: 'none'}} />
  	<input type="text" id={'virtual-keyboard-helper-' + locals.attrs.name} value={locals.value} className="form-control" label={locals.label} onBlur={triggerRealInputChange} />
  </div>;
}

const textboxTemplate = t.form.Form.templates.textbox.clone({ renderInput })

export default class VirtualKeyboardFactory extends t.form.Textbox {

  getTemplate() {
    return textboxTemplate
  }
}
{'fraction_non_alphanumeric': 0.14790647090810222, 'fraction_numerical': 0.0, 'mean_word_length': 5.1952861952861955, 'pattern_counts': {'":': 0, '<': 11, '<?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': '3836841', 'n_tokens_mistral': 574, 'n_tokens_neox': 574, 'n_words': 115}