File tree 1 file changed +13
-1
lines changed
src/components/OptionsList 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -170,14 +170,26 @@ function BaseOptionsList({
170
170
*/
171
171
const renderItem = ( { item, index, section} ) => {
172
172
const isItemDisabled = isDisabled || section . isDisabled || ! ! item . isDisabled ;
173
+ const isSelected = _ . some ( selectedOptions , ( option ) => {
174
+ if ( option . accountID === item . accountID ) {
175
+ return true ;
176
+ }
177
+
178
+ if ( _ . isEmpty ( option . name ) ) {
179
+ return false ;
180
+ }
181
+
182
+ return option . name === item . searchText ;
183
+ } ) ;
184
+
173
185
return (
174
186
< OptionRow
175
187
option = { item }
176
188
showTitleTooltip = { showTitleTooltip }
177
189
hoverStyle = { optionHoveredStyle }
178
190
optionIsFocused = { ! disableFocusOptions && ! isItemDisabled && focusedIndex === index + section . indexOffset }
179
191
onSelectRow = { onSelectRow }
180
- isSelected = { Boolean ( _ . find ( selectedOptions , ( option ) => option . accountID === item . accountID || option . name === item . searchText ) ) }
192
+ isSelected = { isSelected }
181
193
showSelectedState = { canSelectMultipleOptions }
182
194
highlightSelected = { highlightSelectedOptions }
183
195
boldStyle = { boldStyle }
You can’t perform that action at this time.
0 commit comments