Fix color picker closing on toggle

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
rtk-query
marcin mikołajczak 2022-07-18 23:44:37 +02:00
rodzic 827146ad17
commit 15852154c5
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -28,12 +28,14 @@ const ColorWithPicker: React.FC<IColorWithPicker> = ({ buttonId, value, onChange
setPlacement(isMobile(window.innerWidth) ? 'bottom' : 'right');
};
const onToggle: React.MouseEventHandler = () => {
const onToggle: React.MouseEventHandler = (e) => {
if (active) {
hidePicker();
} else {
showPicker();
}
e.stopPropagation();
};
return (