UX questions: Focus styling for anchor tags & trap focus in modal

Hey folks,

I’m trying to improve accessibility and especially keyboard navigation in my app files_linkeditor
But I’ve met two issues that I couldn’t find an answer to in the developer manual:

  1. How can I add focus styles to an anchor tag. There don’t seem to be very many anchor tags (that are not styled as buttons) within Nextcloud so I couldn’t find an example. If I just use a plain anchor tag, the focus style seems to be removed, it’s not visible when tabbing to the link.

  2. I’m using modals for this app, mainly by applying the class oc-dialog. But is there a general path to trap focus in the modal? I believe it would be beneficial if we could tab through all the elements within the modal only (that is, not tabbing into anything beneath the modal), as long as it’s open.

Any help / pointers / discussions are appreciated :slight_smile:
– Thomas