Skip to content

Commit de0bd6a

Browse files
committed
Ensure create item has correct tab index even when select all is disabled
1 parent a1ea63e commit de0bd6a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/select-panel/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ const SelectPanel = () => {
177177
const creationRef: any = useRef();
178178
useKey([KEY.ENTER], handleOnCreateOption, { target: creationRef });
179179

180-
const showCratable =
180+
const showCreatable =
181181
isCreatable &&
182182
searchText &&
183183
!filteredOptions.some((e) => e?.value === searchText);
@@ -227,11 +227,11 @@ const SelectPanel = () => {
227227
options={filteredOptions}
228228
onClick={(_e, index) => handleItemClicked(index)}
229229
/>
230-
) : showCratable ? (
230+
) : showCreatable ? (
231231
<li
232232
onClick={handleOnCreateOption}
233233
className="select-item creatable"
234-
tabIndex={skipIndex === 1 ? 0 : 1}
234+
tabIndex={1}
235235
ref={creationRef}
236236
>
237237
{`${t("create")} "${searchText}"`}

0 commit comments

Comments
 (0)