mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 16:24:45 -07:00
Comprehensive review changes
This commit is contained in:
parent
3aa8c654cc
commit
6074d9d6e4
143 changed files with 2661 additions and 1535 deletions
|
|
@ -88,7 +88,20 @@ function CreateCounterDialog({ isOpen, onSubmit, onCancel }: CreateCounterDialog
|
|||
helperText={error ?? ''}
|
||||
slotProps={{ htmlInput: { 'aria-label': 'Counter name' } }}
|
||||
/>
|
||||
<div className="create-counter-dialog__swatches" role="radiogroup" aria-label="Counter color">
|
||||
<div
|
||||
className="create-counter-dialog__swatches"
|
||||
role="radiogroup"
|
||||
aria-label="Counter color"
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {
|
||||
e.preventDefault();
|
||||
setSelectedIdx((selectedIdx + 1) % SWATCHES.length);
|
||||
} else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {
|
||||
e.preventDefault();
|
||||
setSelectedIdx((selectedIdx - 1 + SWATCHES.length) % SWATCHES.length);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{SWATCHES.map((s, idx) => (
|
||||
<button
|
||||
key={s.label}
|
||||
|
|
@ -96,6 +109,7 @@ function CreateCounterDialog({ isOpen, onSubmit, onCancel }: CreateCounterDialog
|
|||
role="radio"
|
||||
aria-checked={idx === selectedIdx}
|
||||
aria-label={s.label}
|
||||
tabIndex={idx === selectedIdx ? 0 : -1}
|
||||
className={cx('create-counter-dialog__swatch', {
|
||||
'create-counter-dialog__swatch--selected': idx === selectedIdx,
|
||||
})}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue