Focus Trap Component #815

Closed
opened 2026-01-29 17:44:50 +00:00 by claunia · 0 comments
Owner

Originally created by @Cosmatevs on GitHub (Apr 17, 2023).

Is your feature request related to a problem? Please describe.
Dialogs with overlays don't prevent users from focusing elements (with the tab key) underneath them. Therefore, users can click buttons and do other actions under an overlay and it's usually undesirable.
image

Describe the solution you'd like
A focus trap component to wrap a group of focusable elements (e.g. elements in a dialog) which will prevent users from escape with tab outside the group.

Describe alternatives you've considered

  • Do nothing and hope that users won't be trying to escape dialogs with the tab key 🙃 However, they could still do it by accident – as usual.
  • Prepare my own workaround/component. For now, I haven't considered any particular implementation.

Additional context
Such components can be found in MudBlazor and BlazorFluentUI.

Originally created by @Cosmatevs on GitHub (Apr 17, 2023). **Is your feature request related to a problem? Please describe.** [Dialogs](https://blazor.radzen.com/dialog) with overlays don't prevent users from focusing elements (with the tab key) underneath them. Therefore, users can click buttons and do other actions under an overlay and it's usually undesirable. ![image](https://user-images.githubusercontent.com/44393502/232568388-2b764fbf-9988-4c29-998b-c9ecde4a1d39.png) **Describe the solution you'd like** A focus trap component to wrap a group of focusable elements (e.g. elements in a dialog) which will prevent users from escape with tab outside the group. **Describe alternatives you've considered** - Do nothing and hope that users won't be trying to escape dialogs with the tab key 🙃 However, they could still do it by accident – as usual. - Prepare my own workaround/component. For now, I haven't considered any particular implementation. **Additional context** Such components can be found in [MudBlazor](https://mudblazor.com/components/focustrap) and [BlazorFluentUI](https://blazorfluentui.azurewebsites.net/focusTrapZonePage).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#815