@guruhotel/aura-hooks
Version:
🪝 Hooks library designed by the Guruhotel team for Aura UI
1 lines • 300 B
JavaScript
import{findTabbableDescendants as e}from"./tabbable";export function scopeTab(t,n){const o=e(t);if(!o.length)return void n.preventDefault();if(!(o[n.shiftKey?0:o.length-1]===document.activeElement||t===document.activeElement))return;n.preventDefault();const c=o[n.shiftKey?o.length-1:0];c&&c.focus()}