Namespace Dmnk.Blazor.Focus
Provides Blazor components and extensions to manage keyboard focus in Blazor applications.
Classes
- ElementReferenceExtensions
Extends ElementReference with some helper methods to focus elements in a more robust way, or to focus the first/last focusable child of an element.
- FocusTrap
Prevents using the "Tab" key to escape the child components focus. This is mainly useful for dialogs, which should trap the focus while they are active.
For accessibility, you should ALWAYS provide a way to exit the focus trap, e.g. with a keyboard handler on the escape key.
This implemetation is essentially a port of MudFocusTrap.