Skip to content

Commit

Permalink
additionally fixed the same issue in paginatedSelectFiltered as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Spiral-Memory committed Jan 16, 2024
1 parent 1fdf9b5 commit 5c92103
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,24 @@ export const PaginatedSelect = ({
(filter === undefined || visible === AnimatedVisibility.HIDDEN) &&
(valueLabel || placeholder || typeof placeholder === 'string');

const handleOnMouseDown = useEffectEvent(() => {
visible === AnimatedVisibility.VISIBLE ? hide() : show();
});

const handleBlur = useEffectEvent(() => {
visible === AnimatedVisibility.VISIBLE && hide();
});

const handleClick = useEffectEvent(() => {
if (visible === AnimatedVisibility.VISIBLE) {
return hide();
}
if (ref && ref.current) {
ref.current.focus();
return show();
}
ref && ref.current && ref.current.focus();
});

return (
<Box
rcx-select
disabled={disabled}
ref={containerRef}
onMouseDown={handleOnMouseDown}
onClick={handleClick}
className={useMemo(
() => [error && 'invalid', disabled && 'disabled'],
Expand Down Expand Up @@ -110,8 +113,8 @@ export const PaginatedSelect = ({
filter={filter}
ref={ref}
aria-haspopup='listbox'
onClick={show}
onBlur={hide}
// onClick={show}
onBlur={handleBlur}
/>
<Margins inline='x4'>
<SelectAddon>
Expand Down

0 comments on commit 5c92103

Please sign in to comment.