diff --git a/packages/web/src/components/search-bar/ConnectedSearchBar.jsx b/packages/web/src/components/search-bar/ConnectedSearchBar.jsx index deefd0b4fda..c726932f8d3 100644 --- a/packages/web/src/components/search-bar/ConnectedSearchBar.jsx +++ b/packages/web/src/components/search-bar/ConnectedSearchBar.jsx @@ -79,14 +79,21 @@ class ConnectedSearchBar extends Component { onSubmit = (value) => { // Encode everything besides tag searches - if (!value.startsWith('#')) { + const pathname = '/search' + if (value.startsWith('#')) { + // perform tag search + this.props.history.push({ + hash: value.split('#')[1], + pathname, + state: {} + }) + } else { value = encodeURIComponent(value) + this.props.history.push({ + pathname: pathname + '/' + value, + state: {} + }) } - const pathname = `/search/${value}` - this.props.history.push({ - pathname, - state: {} - }) } onSelect = (value) => {