Skip to content

Commit

Permalink
fix: try fix close
Browse files Browse the repository at this point in the history
  • Loading branch information
aeksandla committed Feb 15, 2024
1 parent e000e8e commit 15fd768
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {LegacyRef, MouseEvent, useMemo} from 'react';
import React, {LegacyRef, useMemo} from 'react';

import {Icon, SelectProps} from '@gravity-ui/uikit';

Expand Down Expand Up @@ -42,19 +42,14 @@ export const CustomSwitcher = ({
}, [defaultLabel, initial, list]);
const hasCounter = itemsNames.length > 1;

const handleClick = (e: MouseEvent<HTMLDivElement>) => {
e.currentTarget.focus();
onClick?.();
};

return (
<button
className={b('custom-switcher')}
ref={controlRef as LegacyRef<HTMLButtonElement>}
onKeyDown={onKeyDown}
aria-expanded={open}
>
<div onClick={handleClick} className={b('custom-switcher-element', {overlay: true})} />
<div onClick={onClick} className={b('custom-switcher-element', {overlay: true})} />
<div className={b('custom-switcher-element', {content: true})}>
{itemsNames?.join(', ')}
</div>
Expand Down

0 comments on commit 15fd768

Please sign in to comment.