Initial commit

This commit is contained in:
schihei committed 2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 files changed
+5280367

No files matched your search

@@ -0,0 +1,17 @@
import { useTabster } from './useTabster';
import * as React from 'react';
/**
* Subscribes to the tabster focused element. Calls the callback when the focused element changes.
* @param callback - Callback to subscribe to the focused element.
*/ export function useFocusedElementChange(callback) {
const tabster = useTabster();
React.useEffect(()=>{
if (tabster) {
tabster.focusedElement.subscribe(callback);
return ()=>tabster.focusedElement.unsubscribe(callback);
}
}, [
tabster,
callback
]);
}