Fix custom gradient keyboard mode
This commit is contained in:
parent
a1c7634f23
commit
6154b83720
2 changed files with 13 additions and 5 deletions
|
@ -20,6 +20,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
&__modal__body.module-Modal__body {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
&__bubbles {
|
||||
align-items: center;
|
||||
display: grid;
|
||||
|
|
|
@ -244,17 +244,21 @@ export function GradientDial({
|
|||
};
|
||||
|
||||
const handleKeyDown = (ev: KeyboardEvent) => {
|
||||
let add = 1;
|
||||
|
||||
if (ev.key === 'ArrowDown' || ev.key === arrow('start')) {
|
||||
add = 1;
|
||||
onChange(Math.min(360, Math.max(0, deg + 1)));
|
||||
}
|
||||
|
||||
if (ev.key === 'ArrowUp' || ev.key === arrow('end')) {
|
||||
add = -1;
|
||||
onChange(Math.min(360, Math.max(0, deg - 1)));
|
||||
}
|
||||
|
||||
onChange(Math.min(360, Math.max(0, deg + add)));
|
||||
if (ev.key === 'Enter' && ev.target instanceof HTMLElement) {
|
||||
if (ev.target.ariaLabel === '0') {
|
||||
onClick(KnobType.start);
|
||||
} else if (ev.target.ariaLabel === '1') {
|
||||
onClick(KnobType.end);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
|
Loading…
Reference in a new issue