<commit_before>import React, { PropTypes, PureComponent } from 'react';
import { findDOMNode } from 'react-dom';
import { InputGroup } from 'binary-components';
import { isMobile } from 'binary-utils';
import { actions } from '../_store';
import MarketSubmarketPickerContainer from './MarketSubmarketPickerContainer';

export default class AssetPickerFilter extends PureComponent {

	static propTypes = {
		filter: PropTypes.object.isRequired,
	};

	componentDidMount() {
		const assetSearchNode = findDOMNode(this);
		if (!isMobile()) {
			setTimeout(() => assetSearchNode.firstChild.focus(), 300);
		}
	}

	onSearchQueryChange = e => {
		actions.updateAssetPickerSearchQuery(e.target.value);
	}

	onFilterChange = e => {
		actions.updateAssetPickerFilter(e);
	}

	render() {
		const { filter } = this.props;

		return (
			<div className="asset-picker-filter">
				<InputGroup
					className="asset-search"<commit_msg>Fix asset picker input focus<commit_after>import React, { PropTypes, PureComponent } from 'react';
import { findDOMNode } from 'react-dom';
import { InputGroup } from 'binary-components';
import { isMobile } from 'binary-utils';
import { actions } from '../_store';
import MarketSubmarketPickerContainer from './MarketSubmarketPickerContainer';

export default class AssetPickerFilter extends PureComponent {

	static propTypes = {
		filter: PropTypes.object.isRequired,
	};

	componentDidMount() {
		const assetSearchNode = findDOMNode(this);
		if (!isMobile()) {
			setTimeout(() =>
				assetSearchNode.firstChild &&
				assetSearchNode.firstChild.firstChild &&
				assetSearchNode.firstChild.firstChild.focus(),
			100);
		}
	}

	onSearchQueryChange = e => {
		actions.updateAssetPickerSearchQuery(e.target.value);
	}

	onFilterChange = e => {
		actions.updateAssetPickerFilter(e);
	}

	render() {
		const { filter } = this.props;

		return (
			<div className="asset-picker-filter">
				<InputGroup
					className="asset-search"
{'fraction_non_alphanumeric': 0.125, 'fraction_numerical': 0.0030737704918032786, 'mean_word_length': 4.644508670520231, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5815553', 'n_tokens_mistral': 636, 'n_tokens_neox': 565, 'n_words': 125}