Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Tab(element, { shiftKey }) {
const body = element.ownerDocument?.body || document.body;
const nextElement = shiftKey
? getPreviousTabbableIn(body)
: getNextTabbableIn(body);
if (nextElement) {
focus(nextElement);
}
},