Skip to content

Commit 257020a

Browse files
soorajbalaJeevan-Kishore
authored andcommitted
fix(search-box): Implement initialValue - searchbox (#70)
* search query initial state option added * pr changes. props validation
1 parent 58f4682 commit 257020a

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/components/search-box.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import React from 'react';
2+
import PropTypes from "prop-types";
23
import {NavigationComponentBase} from "./navigation-component-base";
34

45
export class SearchBox extends NavigationComponentBase {
56
constructor(props) {
67
super(props);
78
this.state = {
8-
query: ''
9+
query: this.props.initValue || ""
910
};
1011
}
1112

@@ -50,3 +51,15 @@ export class SearchBox extends NavigationComponentBase {
5051
}
5152

5253
}
54+
55+
SearchBox.protoTypes = {
56+
initValue: PropTypes.string,
57+
placeholder: PropTypes.string,
58+
className: PropTypes.string,
59+
formRef: PropTypes.any,
60+
inputClassName: PropTypes.string,
61+
inputId: PropTypes.string,
62+
template: PropTypes.element,
63+
onSubmitHandler: PropTypes.func,
64+
onEscape: PropTypes.func
65+
}

0 commit comments

Comments
 (0)