Provide a way for people using a screen reader and/or keyboard navigation to remove attachments and add captions
There isn't a way for people using a screen reader to access the remove attachment button or the caption element associated with each attachment.
Steps to Reproduce
- Drop an image into the Trix editor.
- Press tab and shift-tab in an attempt to focus the Remove button and
elements associated with the attachment added in step 1. - Realize it's not possible to achieve.
I believe the proper way to implement this is by including the remove button and caption input elements sequentially in the tab order. In #448 we made a tweak so that attachment links are no longer included in the composer tab sequence. #448 is still an improvement since before that tabbing would just focus the around the attachment but not the remove button or
Details
- Trix version:
- Browser name and version: Safari
- Operating system: 10.13.5
cc @javan @sstephenson
Press tab and shift-tab in an attempt to focus the Remove button
The remove button and caption field are only present when an attachment is selected, which you can do by moving the cursor to it with the arrow keys. Once selected you can tab to the remove button and press return to remove the attachment:

Does that make the remove button accessible enough? If so then it's just the caption field that needs addressing.
Nice I think this implementation works ok. The one thing that's funky is when you focus the attachment (by moving to it with your cursor), VoiceOver speaks "space" (or I think whatever character is directly before the image), so it isn't clear that the attachment is focused. Seeing similar quirkiness with other screen readers.
Fixed in https://github.com/basecamp/trix/pull/523