Skip to content

Commit

Permalink
feat: rename func
Browse files Browse the repository at this point in the history
  • Loading branch information
RostiMelk authored and mariuslundgard committed Jun 25, 2024
1 parent 28086f4 commit 321b4d6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core/components/autocomplete/autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete<
[onQueryChange],
)

const handleDispatchOpen = useCallback(() => {
const dispatchOpen = useCallback(() => {
dispatch({
type: 'root/open',
query: value ? renderValue(value, currentOption) : '',
Expand All @@ -370,10 +370,10 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete<
dispatch({type: 'input/focus'})

if (onFocus) onFocus(event)
if (openOnFocus) handleDispatchOpen()
if (openOnFocus) dispatchOpen()
}
},
[focused, onFocus, openOnFocus, handleDispatchOpen],
[focused, onFocus, openOnFocus, dispatchOpen],
)

const handlePopoverMouseEnter = useCallback(() => {
Expand Down Expand Up @@ -478,13 +478,13 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete<

const handleOpenClick = useCallback(
(event: MouseEvent<HTMLButtonElement>) => {
handleDispatchOpen()
dispatchOpen()

if (openButtonProps.onClick) openButtonProps.onClick(event)

_raf(() => inputElementRef.current?.focus())
},
[openButtonProps, handleDispatchOpen],
[openButtonProps, dispatchOpen],
)

const openButtonNode = useMemo(
Expand Down

0 comments on commit 321b4d6

Please sign in to comment.