File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ function stateToQueryString(state) {
106106
107107/**
108108 * The URL Manager is responsible for synchronizing state between
109- * AppSearchDriver and the URL. There are 3 main cases to handle when
109+ * AppSearchDriver and the URL. There are 2 main cases we handle when
110110 * synchronizing:
111111 *
112112 * 1. When the app loads, AppSearchDriver will need to
@@ -117,8 +117,8 @@ function stateToQueryString(state) {
117117 * AppSearchDriver will need to be notified and given the updated state, so that
118118 * it can re-run the current search. `onURLStateChange` is used for this case.
119119 *
120- * 3. When state changes in AppSearchDriver, the URL will need to be updated
121- * to reflect those changes. `onURLStateChange` is used for this case .
120+ * A third case would be handling an update on `history.pushState`, but that
121+ * is outside the scope of this Reference UI for now .
122122 */
123123
124124export default class URLManager {
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import SearchBox from "../components/SearchBox";
66
77export class SearchBoxContainer extends Component {
88 static propTypes = {
9+ searchTerm : PropTypes . string . isRequired ,
910 setSearchTerm : PropTypes . func . isRequired
1011 } ;
1112
@@ -14,6 +15,11 @@ export class SearchBoxContainer extends Component {
1415 isFocused : false
1516 } ;
1617
18+ constructor ( props ) {
19+ super ( ) ;
20+ this . state . value = props . searchTerm ;
21+ }
22+
1723 handleFocus = e => {
1824 this . setState ( {
1925 isFocused : true
You can’t perform that action at this time.
0 commit comments