fn
focusGuard
v0.0.3testedAdds 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
export function focusGuard(namespace = 'focus-guard'){ ... }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