Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search string space bug #2105

Merged
merged 2 commits into from
Apr 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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