Skip to content

Commit

Permalink
fix: 🐛 create item tab index (#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaKeegMan authored Aug 3, 2022
1 parent 5f8bd28 commit 4ad16f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/select-panel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ const SelectPanel = () => {
const creationRef: any = useRef();
useKey([KEY.ENTER], handleOnCreateOption, { target: creationRef });

const showCratable =
const showCreatable =
isCreatable &&
searchText &&
!filteredOptions.some((e) => e?.value === searchText);
Expand Down Expand Up @@ -227,11 +227,11 @@ const SelectPanel = () => {
options={filteredOptions}
onClick={(_e, index) => handleItemClicked(index)}
/>
) : showCratable ? (
) : showCreatable ? (
<li
onClick={handleOnCreateOption}
className="select-item creatable"
tabIndex={skipIndex === 1 ? 0 : 1}
tabIndex={1}
ref={creationRef}
>
{`${t("create")} "${searchText}"`}
Expand Down

0 comments on commit 4ad16f1

Please sign in to comment.