Skip to content

Commit

Permalink
Clear documentation search on nav click (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
snide authored Mar 12, 2018
1 parent 3e1eff1 commit 416a9d3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src-docs/src/components/guide_page/guide_page_chrome.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import $ from 'jquery';
import {hashHistory} from 'react-router';

import {
Link,
Expand Down Expand Up @@ -59,6 +60,16 @@ export class GuidePageChrome extends Component {
});
};

onClickRoute = path => {

this.setState({
search: '',
isSideNavOpenOnMobile: false,
});

hashHistory.push(path);
};

renderIdentity() {
const homeLink = (
<Link
Expand Down Expand Up @@ -116,7 +127,7 @@ export class GuidePageChrome extends Component {
return {
id: `${section.type}-${path}`,
name,
href: `#/${path}`,
onClick: this.onClickRoute.bind(this, path),
items: this.renderSubSections(sections),
isSelected: name === this.props.currentRouteName,
};
Expand Down

0 comments on commit 416a9d3

Please sign in to comment.