<commit_before>var React = require('react/addons');
var blacklist = require('blacklist');

var Button = require('./Button');
var Spinner = require('./Spinner');

module.exports = React.createClass({
	displayName: 'FileUpload',
	propTypes: {
		buttonLabelChange: React.PropTypes.string,
		buttonLabelInitial: React.PropTypes.string,
		disabled: React.PropTypes.bool,
		file: React.PropTypes.object, // https://developer.mozilla.org/en/docs/Using_files_from_web_applications
		onChange: React.PropTypes.func
	},
	getDefaultProps() {
		return {
			buttonLabelInitial: 'Upload File',
			buttonLabelChange:  'Change File'
		};
	},
	getInitialState() {
		return {
			file: {},
			loading: false
		};
	},

	triggerFileBrowser() {
		this.refs.fileInput.getDOMNode().click();
	},
	handleChange(e) {
		var self = this;<commit_msg>fix a fileUpload bug<commit_after>var React = require('react/addons');
var blacklist = require('blacklist');

var Button = require('./Button');
var Spinner = require('./Spinner');

module.exports = React.createClass({
	displayName: 'FileUpload',
	propTypes: {
		buttonLabelChange: React.PropTypes.string,
		buttonLabelInitial: React.PropTypes.string,
		disabled: React.PropTypes.bool,
		file: React.PropTypes.object, // https://developer.mozilla.org/en/docs/Using_files_from_web_applications
		onChange: React.PropTypes.func
	},
	getDefaultProps() {
		return {
			buttonLabelInitial: 'Upload File',
			buttonLabelChange:  'Change File'
		};
	},
	getInitialState() {
		return {
			file: {},
			loading: false
		};
	},
        componentDidMount () {
               this.refs.fileInput.getDOMNode().addEventListener('click', function () {
                       this.value = '';
               },   false);
        },
	triggerFileBrowser() {
		this.refs.fileInput.getDOMNode().click();
	},
	handleChange(e) {
		var self = this;
{'fraction_non_alphanumeric': 0.14587852494577006, 'fraction_numerical': 0.0, 'mean_word_length': 3.829842931937173, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '748652', 'n_tokens_mistral': 619, 'n_tokens_neox': 572, 'n_words': 101}