Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1587419 - Search keyword does not appear in the input text box fi…
Browse files Browse the repository at this point in the history
…eld after reopening network panel search. r=Honza

Differential Revision: https://phabricator.services.mozilla.com/D48739
  • Loading branch information
lloan committed Oct 11, 2019
1 parent 11d8d98 commit 35191b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion devtools/client/netmonitor/src/components/search/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class Toolbar extends Component {
caseSensitive: PropTypes.bool.isRequired,
toggleCaseSensitiveSearch: PropTypes.func.isRequired,
connector: PropTypes.object.isRequired,
query: PropTypes.string,
};
}

Expand Down Expand Up @@ -124,15 +125,17 @@ class Toolbar extends Component {
addSearchQuery,
clearSearchResultAndCancel,
connector,
query,
} = this.props;
return SearchBox({
keyShortcut: "CmdOrCtrl+Shift+F",
placeholder: L10N.getStr("netmonitor.search.toolbar.inputPlaceholder"),
type: "search",
delay: FILTER_SEARCH_DELAY,
ref: this.props.searchboxRef,
value: query,
onClearButtonClick: () => clearSearchResultAndCancel(),
onChange: query => addSearchQuery(query),
onChange: newQuery => addSearchQuery(newQuery),
onKeyDown: event => this.onKeyDown(event, connector),
});
}
Expand All @@ -153,6 +156,7 @@ class Toolbar extends Component {
module.exports = connect(
state => ({
caseSensitive: state.search.caseSensitive,
query: state.search.query,
}),
dispatch => ({
closeSearch: () => dispatch(Actions.closeSearch()),
Expand Down
3 changes: 2 additions & 1 deletion devtools/client/shared/components/SearchBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ class SearchBox extends PureComponent {
summary: PropTypes.string,
summaryTooltip: PropTypes.string,
type: PropTypes.string,
value: PropTypes.string,
};
}

constructor(props) {
super(props);

this.state = {
value: "",
value: props.value || "",
focused: false,
};

Expand Down

0 comments on commit 35191b4

Please sign in to comment.