Last active
April 27, 2016 15:15
-
-
Save beckettkev/d4b126950acba44fdf4698f0f37316bc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setSearchFocus () { | |
if (this.refs['searchInput'] !== null) { | |
if (Golfish.interval !== null) { | |
window.clearInterval(Goldfish.interval); | |
} | |
//in the console check the value of this.refs['searchInput']; | |
this.refs['searchInput'].focus(); | |
} else { | |
Goldfish.interval = Goldfish.interval || window.setInterval(function () { | |
this.setSearchFocus(); | |
}, 1000); | |
} | |
}, | |
componentDidMount () { | |
SearchStore.addChangeListener(this.onComponentChange.bind(this)); | |
this.setSearchFocus.bind(this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment