Skip to content

Commit 272fc46

Browse files
committed
Revert "Update URL with search query, select text"
This reverts commit 38ffaf6.
1 parent 38ffaf6 commit 272fc46

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

src/search/components/SearchForm.js

-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ export class SearchFormBase extends React.Component {
1919
router: PropTypes.object,
2020
}
2121

22-
componentDidMount() {
23-
this.refs.query.select();
24-
}
25-
2622
goToSearch(query) {
2723
const { pathname } = this.props;
2824
this.context.router.push(`${pathname}?q=${query}`);

src/search/components/SearchPage.js

-17
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import SearchResults from './SearchResults';
99
export default class SearchPage extends React.Component {
1010
static propTypes = {
1111
count: PropTypes.number,
12-
location: PropTypes.object.isRequired,
1312
loading: PropTypes.bool.isRequired,
1413
page: PropTypes.number,
1514
results: PropTypes.arrayOf(PropTypes.shape({
@@ -19,22 +18,6 @@ export default class SearchPage extends React.Component {
1918
query: PropTypes.string,
2019
}
2120

22-
static contextTypes = {
23-
router: PropTypes.object.isRequired,
24-
}
25-
26-
componentDidMount() {
27-
const { location, query } = this.props;
28-
const { router } = this.context;
29-
const url = {
30-
...location,
31-
query: { ...location.query, q: query },
32-
};
33-
if (query && !router.isActive(url)) {
34-
router.replace(url);
35-
}
36-
}
37-
3821
render() {
3922
const { count, loading, page, query, results } = this.props;
4023
const pathname = '/search/';

0 commit comments

Comments
 (0)