@@ -20,7 +20,7 @@ const ListItem = ({
20
20
onSelect,
21
21
children,
22
22
setSelected,
23
- removeSelected = ( ) => { } ,
23
+ removeSelected = ( ) => { } ,
24
24
} ) => {
25
25
const ref = useRef ( null ) ;
26
26
@@ -49,7 +49,7 @@ const ListItem = ({
49
49
onClick = { onSelect }
50
50
>
51
51
{ children }
52
- { selected && (
52
+ { selected && (
53
53
< kbd >
54
54
Enter ↵
55
55
</ kbd >
@@ -73,8 +73,8 @@ ListItem.defaultProps = {
73
73
selected : false ,
74
74
onSelect : null ,
75
75
children : null ,
76
- setSelected : ( ) => { } ,
77
- removeSelected : ( ) => { } ,
76
+ setSelected : ( ) => { } ,
77
+ removeSelected : ( ) => { } ,
78
78
} ;
79
79
80
80
const Divider = ( { legend } ) => (
@@ -118,7 +118,7 @@ const VariableSpotlight = (props) => {
118
118
options . sort ( sortByLabel ) ;
119
119
120
120
if ( ! filterTerm ) { return options ; }
121
- return options . filter ( ( item ) => item . label . includes ( filterTerm ) ) ;
121
+ return options . filter ( ( item ) => item . label . toLowerCase ( ) . includes ( filterTerm . toLowerCase ( ) ) ) ;
122
122
} , [ filterTerm , options ] ) ;
123
123
124
124
const existingVariables = useSelector (
@@ -143,29 +143,29 @@ const VariableSpotlight = (props) => {
143
143
const renderResults = ( ) => (
144
144
< Scroller >
145
145
< ol >
146
- { filterTerm && options . filter ( ( item ) => item . label === filterTerm ) . length !== 1 && (
146
+ { filterTerm && options . filter ( ( item ) => item . label === filterTerm ) . length !== 1 && (
147
147
< >
148
148
{
149
149
disallowCreation
150
150
&& hasFilterTerm
151
151
&& ! hasFilterResults
152
152
&& (
153
- < div className = "variable-spotlight__empty" >
154
- < Icon name = "warning" />
155
- < div >
156
- < p >
157
- You cannot create a new
158
- variable from here. Please create one or more variables elsewhere
159
- in your protocol, and return here to select them.
160
- </ p >
153
+ < div className = "variable-spotlight__empty" >
154
+ < Icon name = "warning" />
155
+ < div >
156
+ < p >
157
+ You cannot create a new
158
+ variable from here. Please create one or more variables elsewhere
159
+ in your protocol, and return here to select them.
160
+ </ p >
161
+ </ div >
161
162
</ div >
162
- </ div >
163
163
)
164
164
}
165
- { ! disallowCreation && (
165
+ { ! disallowCreation && (
166
166
< >
167
167
< Divider legend = "Create" />
168
- { ! invalidVariableName ? (
168
+ { ! invalidVariableName ? (
169
169
< ListItem
170
170
onSelect = { handleCreateOption }
171
171
selected = { showCursor && cursor === - 1 }
@@ -199,12 +199,12 @@ const VariableSpotlight = (props) => {
199
199
) }
200
200
</ >
201
201
) }
202
- { hasFilterResults && (
202
+ { hasFilterResults && (
203
203
< Divider
204
204
legend = { hasFilterTerm ? `Existing Variables Containing "${ filterTerm } "` : 'Existing Variables' }
205
205
/>
206
206
) }
207
- { sortedAndFilteredItems . map ( ( { value, label, type : optionType } , index ) => (
207
+ { sortedAndFilteredItems . map ( ( { value, label, type : optionType } , index ) => (
208
208
< ListItem
209
209
key = { value }
210
210
onSelect = { ( ) => onSelect ( value ) }
@@ -340,7 +340,7 @@ const VariableSpotlight = (props) => {
340
340
variants = { resultsVariants }
341
341
transition = { { duration : 0.2 , ease : 'easeInOut' } }
342
342
>
343
- { ! disallowCreation && ! hasOptions && (
343
+ { ! disallowCreation && ! hasOptions && (
344
344
< div className = "variable-spotlight__empty" >
345
345
< Icon name = "info" />
346
346
< div >
@@ -353,7 +353,7 @@ const VariableSpotlight = (props) => {
353
353
</ div >
354
354
</ div >
355
355
) }
356
- { disallowCreation && ! hasFilterTerm && ! hasOptions && (
356
+ { disallowCreation && ! hasFilterTerm && ! hasOptions && (
357
357
< div className = "variable-spotlight__empty" >
358
358
< Icon name = "warning" />
359
359
< div >
@@ -365,7 +365,7 @@ const VariableSpotlight = (props) => {
365
365
</ div >
366
366
</ div >
367
367
) }
368
- { renderResults ( ) }
368
+ { renderResults ( ) }
369
369
</ motion . main >
370
370
</ motion . div >
371
371
) ;
0 commit comments