cds-snc / cds-snc/platform-forms-client

Secondary button is sometimes first in focus on modals

Open
#5,384 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
46
Forks
16
Avg merge
1d 8h
Merged PRs (30d)
85

Description

## Description
When saving a copy of form answers in progress (or submitted) the modal that pops up has the "Cancel" button in focus by default.

## Expected behaviour

Since "Cancel" is the secondary action here and "Save" is the primary action that most people will intend to take, might we consider having it displayed first and in focus to allow users to simply click / tap enter to continue toward their goal? Or could the "Save" be the first thing in focus?

## Steps to reproduce
1. Go to Form with save progress
2. Click on "Save to device"
3. Continue on to submit
4. Download a copy of answers
5. See the modal in both cases

## Details
- **Browser**: Chrome
- **Operating system**: Mac
- **Environment**: Production
- **Language**: English and French
- **Viewport**: Desktop
- **Output**: ex: https://forms-formulaires.alpha.canada.ca/en/id/cm98mduls000yyd01jwibk2bn

## Screenshots or videos

Screenshot 2025-04-08 at 12.17.55 PM.png

Screenshot 2025-04-08 at 12.14.49 PM.png

## Additional context

This might be the case for all "modal" type interactions

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.