Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@
## 2024-07-14 - Native Keyboard Submission with Forms for Modals
**Learning:** Modals designed with plain `<div>` elements as wrappers instead of `<form>` lack native keyboard submission support, forcing users to switch from keyboard to mouse to confirm actions like "Save".
**Action:** When designing modals or popups containing inputs, always use a `<form>` element to wrap the content, handle the `onSubmit` event (calling `e.preventDefault()`), and set the primary confirmation button to `type="submit"` to enable seamless Enter-key submission for keyboard users.
## 2024-05-18 - Color Swatch Radiogroup Accessibility
**Learning:** Using a custom color swatch component with `role="radiogroup"` requires its children to use `role="radio"` and `aria-checked` rather than generic buttons with `aria-pressed`. `aria-pressed` inside a radiogroup creates a mismatched role structure that confuses screen readers.
**Action:** When building custom radio groups (like color swatches), always ensure the children explicitly use `role="radio"` and `aria-checked` to perfectly simulate native radio button semantics.
3 changes: 2 additions & 1 deletion frontend/src/components/modals/GroupModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ export function GroupModal({
{BUSINESS_GROUP_COLORS.map((color) => (
<button
type="button"
role="radio"
aria-label={`์ƒ‰์ƒ ${color}`}
aria-pressed={newGroupColor === color}
aria-checked={newGroupColor === color}
className="groupManager__swatch"
key={color}
onClick={() => setNewGroupColor(color)}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/modals/ModalCoverage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ describe('modal behavior coverage', () => {
/>,
)
fireEvent.change(screen.getByLabelText('๊ทธ๋ฃน ์ด๋ฆ„'), { target: { value: 'New' } })
fireEvent.click(screen.getAllByRole('button', { name: /^์ƒ‰์ƒ / })[1]!)
fireEvent.click(screen.getAllByRole('radio', { name: /^์ƒ‰์ƒ / })[1]!)
fireEvent.click(screen.getByRole('button', { name: '์ถ”๊ฐ€' }))
fireEvent.click(screen.getByRole('button', { name: 'Billing ๊ทธ๋ฃน ์‚ญ์ œ' }))
fireEvent.change(screen.getByRole('combobox'), { target: { value: '' } })
Expand Down
Loading