fn
focusGuard
v0.0.3Adds a pair of focus guards at the boundaries of the DOM tree to ensure consistent focus behavior
Examples
ts
const guard = focusGuard();
guard.createGuard();
guard.removeGuard();ts
const guard = focusGuard('focus-guard');
guard.createGuard();
guard.removeGuard();Signature
ts
declare function focusGuard(namespace?: string): {
selector: string;
createGuard: () => void;
removeGuard: () => void;
};Parameters
| Parameter | Type | Description |
|---|---|---|
namespace? | string | The namespace to use for the guard attributes |
Returns
{ selector: string; createGuard: () => void; removeGuard: () => void; }- An object containing the selector, createGuard, and removeGuard functions| Property | Type | Description |
|---|---|---|
selector | string | — |
createGuard | () => void | — |
removeGuard | () => void | — |