This commit is contained in:
Panayiotis Lipiridis 2020-12-28 01:26:38 +02:00
parent 2712a06ab8
commit 428752542d
4 changed files with 10 additions and 10 deletions

View file

@ -14,11 +14,11 @@ export const ButtonIconCycle = <T extends any>({
}) => {
const current = options.find((op) => op.value === value);
function cycle() {
const cycle = () => {
const index = options.indexOf(current!);
const next = (index + 1) % options.length;
onChange(options[next].value);
}
};
return (
<label key={group} className={clsx({ active: current!.value !== null })}>