touchpoints
touchpoints copied to clipboard
WIP focus setting for modal open and close
For @ryanwoldatwork and @iamjolly to pair on.
Relates to #480
Things to do:
- [x] Set focus on modal
div
when opened - [x] Set focus back to touchpoints
button
when modal is closed - [x] Confirm listener for
esc
keypress to run thehandleDialogClose
function. - [ ] Trap focus in modal when opened - see Using JavaScript to trap focus in an element for more info
- [ ] Test with keyboard only and with screen reader to confirm everything works as expected.
Note: This is a vanilla JS approach to adding accessibility to the modal. A next effort should involve looking at ways for touchpoints to use the USWDS modal component per #481.