NoRedInk/noredink-ui/14.3.0

NOTE: the latest version is 35.9.3

Nri.Ui.FocusTrap.V1

Create a focus trap.

type alias FocusTrap msg =
{ firstId : String
, lastId : String
, focus : String -> msg
}

Defines how focus will wrap in reponse to tab keypresses in a part of the UI.

The ids referenced here are expected to correspond to elements in the container we are applying the focus trap on.

toAttribute : FocusTrap msg -> Attribute msg

Attach this attribute to add a focus trap to an HTML element.