Get focusable elements inside a passed container and return as an array.

Parameters:
NameTypeDescription
containerDocument | HTMLElement

The parent to search for focusable elements inside.

Since
  • 1.0.0
Returns:

An array of focusable elements.

Type: 
Array
Example
import { getFocusable } from  "@gravityforms/utils";

function Example() {
 const focusable = getFocusable( container );
	// store first and last visible item
	const firstFocusableEl = focusable[ 0 ];
	const lastFocusableEl = focusable[ focusable.length - 1 ];
}

Requires