add auto link

This commit is contained in:
xmcp
2018-08-21 13:03:58 +08:00
parent 35e6a08ec9
commit 3497c664d5
8 changed files with 78 additions and 14 deletions

View File

@@ -42,6 +42,16 @@ class ControlBar extends Component {
this.set_search_text=props.set_search_text;
}
componentDidMount() {
if(window.location.hash) {
const text=window.location.hash.substr(1);
this.setState({
search_text: text,
});
this.set_search_text(text);
}
}
on_change(event) {
this.setState({
search_text: event.target.value,