Skip to content

Commit

Permalink
fix(@clayui/multi-select): fix error when not invoking method of `onF…
Browse files Browse the repository at this point in the history
…ocus` when defined
  • Loading branch information
matuzalemsteles committed Jun 16, 2023
1 parent f6ef5be commit 934878a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/clay-multi-select/src/index.tsx
Expand Up @@ -377,11 +377,18 @@ const ClayMultiSelect = React.forwardRef<HTMLDivElement, IProps<unknown>>(
onChange={setValue}
onFocus={
MenuRenderer && sourceItems
? () =>
? (
event: React.FocusEvent<HTMLInputElement>
) => {
if (otherProps.onFocus) {
otherProps.onFocus(event);
}

setActive(
!!value && sourceItems.length !== 0
)
: undefined
);
}
: otherProps.onFocus
}
onFocusChange={setIsFocused}
onItemsChange={hasAsyncItems ? () => {} : undefined}
Expand Down

0 comments on commit 934878a

Please sign in to comment.