Skip to content

Commit 8b1d93a

Browse files
committed
feat: support useFocusLock
1 parent 59eeebc commit 8b1d93a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Dom/focus.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,11 @@ export function lockFocus(element: HTMLElement): VoidFunction {
173173
};
174174
}
175175

176+
/**
177+
* Lock focus within an element.
178+
* When locked, focus will be restricted to focusable elements within the specified element.
179+
* If multiple elements are locked, only the last locked element will be effective.
180+
*/
176181
export function useLockFocus(
177182
lock: boolean,
178183
getElement: () => HTMLElement | null,

0 commit comments

Comments
 (0)