File tree 2 files changed +18
-11
lines changed
2 files changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ Whether you want to showcase a constant list of options or dynamically adapt to
14
14
15
15
- Clear button
16
16
17
- - ` Rtl ` support
17
+ - Rtl support
18
18
19
19
- Flexible style
20
20
@@ -75,6 +75,16 @@ function App() {
75
75
- ** onChange**
76
76
- type : ` Func `
77
77
- description : onChange Handler for the input value
78
+ - ** onClear?**
79
+ - type : ` Func `
80
+ - description : triggered when the user clicks on the Clear icon
81
+ - ** theme?**
82
+ - type : ` "outline"|"underline"|"panel" `
83
+ - description : searchbox theme
84
+ - default : ` "outline" `
85
+ - ** autoFocus?**
86
+ - type : ` Boolean `
87
+ - default : ` Fasle `
78
88
- ** children**
79
89
- type : ` ReactNode `
80
90
- description : suggestions list
@@ -116,16 +126,10 @@ function App() {
116
126
- ** MagnifierIconComponent?**
117
127
- type : ` React function component `
118
128
- description : custom Magnifier icon
119
- - ** onClear?**
120
- - type : ` Func `
121
- - description : triggered when the user clicks on the Clear icon
122
- - ** theme?**
123
- - type : ` "outline"|"underline"|"panel" `
124
- - description : searchbox theme
125
- - default : ` "outline" `
126
- - ** autoFocus?**
127
- - type : ` Boolean `
128
- - default : ` Fasle `
129
+ - ** inputName?**
130
+ - type : ` String `
131
+ - description : name attribute for the input element
132
+ - default : ` "" `
129
133
130
134
## Test
131
135
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import ClearIcon from './icons/clear.js';
24
24
* @param {"underline"|"outline"|"panel" } [props.theme="outline"] - searchbox theme
25
25
* @param {Boolean } [props.corner=true] - if set true then border-radius would be "5px"
26
26
* @param {Boolean } [props.autoFocus=false] - autoFocus attribute for the input element
27
+ * @param {String } [props.inputName=""] - name attribute for the input element
27
28
*/
28
29
function ReactCustomSearchList ( props ) {
29
30
const {
@@ -46,6 +47,7 @@ function ReactCustomSearchList(props) {
46
47
theme = 'outline' ,
47
48
corner = true ,
48
49
autoFocus = false ,
50
+ inputName = '' ,
49
51
} = props ;
50
52
const [ open , setOpen ] = useState ( false ) ;
51
53
const rootRef = useRef ( ) ;
@@ -99,6 +101,7 @@ function ReactCustomSearchList(props) {
99
101
placeholder = { placeholder }
100
102
style = { inputStyle }
101
103
autoFocus = { autoFocus }
104
+ { ...( inputName ? { name : inputName } : { } ) }
102
105
/>
103
106
{ ClearIconComponent ? < ClearIconComponent value = { value } onClear = { onClear } /> : null }
104
107
You can’t perform that action at this time.
0 commit comments