Fix color picker closing on toggle
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
827146ad17
commit
15852154c5
1 changed files with 3 additions and 1 deletions
|
@ -28,12 +28,14 @@ const ColorWithPicker: React.FC<IColorWithPicker> = ({ buttonId, value, onChange
|
||||||
setPlacement(isMobile(window.innerWidth) ? 'bottom' : 'right');
|
setPlacement(isMobile(window.innerWidth) ? 'bottom' : 'right');
|
||||||
};
|
};
|
||||||
|
|
||||||
const onToggle: React.MouseEventHandler = () => {
|
const onToggle: React.MouseEventHandler = (e) => {
|
||||||
if (active) {
|
if (active) {
|
||||||
hidePicker();
|
hidePicker();
|
||||||
} else {
|
} else {
|
||||||
showPicker();
|
showPicker();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e.stopPropagation();
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in a new issue