Skip to content

Commit f3b5cf6

Browse files
committed
DDW-645 - Update react-polymorph and implement the search style variables - fixing lint issues
1 parent 5554a51 commit f3b5cf6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/skins/simple/OptionsSkin.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export const OptionsSkin = (props: Props) => {
8989
if (!noResults && render) {
9090
// call user's custom render function
9191
return render(getOptionProps);
92-
} else if (!noResults && !render) {
92+
} if (!noResults && !render) {
9393
// render default simple skin
9494
return sortedOptions.map((option, index) => {
9595
// set reference of event handlers in memory to prevent excess re-renders
@@ -127,12 +127,12 @@ export const OptionsSkin = (props: Props) => {
127127
if (optionRenderer && isFunction(optionRenderer)) {
128128
// call user's custom rendering logic
129129
return optionRenderer(option);
130-
} else if (isObject(option)) {
130+
} if (isObject(option)) {
131131
let { label } = option;
132132
// in case `highlightSearch` then `searchValue` is wrapped in an `em` tag
133133
if (highlightSearch !== false) {
134134
const splitter = new RegExp(`(${escapedSearchValue})`,'i');
135-
const parts = label.split(splitter);
135+
const parts = typeof label === 'string' ? label.split(splitter) : label;
136136
for (let i = 1; i < parts.length; i += 2) {
137137
if (parts[i].toLowerCase() === `${escapedSearchValue}`.toLowerCase())
138138
parts[i] = <em>{parts[i]}</em>;
@@ -151,7 +151,7 @@ export const OptionsSkin = (props: Props) => {
151151
theme={theme}
152152
value={searchValue}
153153
onChange={props.onSearch}
154-
autoFocus={true}
154+
autoFocus
155155
inputRef={props.searchInputRef || null}
156156
/>
157157
{!props.hideSearchClearButton && (

0 commit comments

Comments
 (0)