Skip to content

Commit

Permalink
Merge pull request #2105 from veteransaffairscanada/search_string_spa…
Browse files Browse the repository at this point in the history
…ce_bug

Search string space bug
  • Loading branch information
Sarah Thompson authored Apr 23, 2019
2 parents 629fb15 + 5d57734 commit f0f9dd7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions components/search_box.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import styled from "@emotion/styled";
import SearchIcon from "./icons/Search";
import CancelIcon from "./icons/Cancel";
import { globalTheme } from "../theme";
import Router from "next/router";
import { mutateUrl } from "../utils/common";
// import Router from "next/router";
// import { mutateUrl } from "../utils/common";

const SearchBoxWrapper = styled("div")({
boxSizing: "border-box",
Expand Down Expand Up @@ -107,8 +107,8 @@ class SearchBox extends Component {
}
handleChange = event => {
this.setState({ value: event.target.value }); // state of InputSearchBox
this.props.url.query.searchString = event.target.value;
Router.replace(mutateUrl(this.props.url));
// this.props.url.query.searchString = event.target.value.split(" ").join("-");
// Router.replace(mutateUrl(this.props.url));
if (this.props.onChange) {
this.props.onChange(event);
}
Expand All @@ -117,8 +117,8 @@ class SearchBox extends Component {
handleClear = () => {
this.textInput.current.value = "";
this.setState({ value: "" }); // state of InputSearchBox
this.props.url.query.searchString = "";
Router.replace(mutateUrl(this.props.url));
// this.props.url.query.searchString = "";
// Router.replace(mutateUrl(this.props.url));
if (this.props.onClear) {
this.props.onClear();
}
Expand Down

0 comments on commit f0f9dd7

Please sign in to comment.