Skip to content

Commit

Permalink
fix: single & multi select click item bug
Browse files Browse the repository at this point in the history
  • Loading branch information
owenlongbo committed Oct 27, 2023
1 parent 3dac1fe commit 92be11d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions packages/select/src/multiple-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,7 @@ export const MultipleSelect = forwardRef<HTMLDivElement, SelectProps>(
inputTagRef.current?.focus()
}}
onClickItem={(key) => {
const option = finalOptions.find(
(option) => String(option.value) === key,
)
const option = finalOptions.find((option) => option.value === key)
if (option) {
if (labelInValue) {
let selectedValue = (finalValue as SelectOptionObject[]).find(
Expand Down
4 changes: 1 addition & 3 deletions packages/select/src/single-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,7 @@ export const SingleSelect = forwardRef<HTMLInputElement, SelectProps>(
<DropList
maxH="264px"
onClickItem={(key, children) => {
const option = finalOptions.find(
(option) => String(option.value) === key,
)
const option = finalOptions.find((option) => option.value === key)
if (option !== undefined) {
if (labelInValue) {
if (value === undefined) {
Expand Down

0 comments on commit 92be11d

Please sign in to comment.