Focus
The wb-focus component in WET-BOEW provides a user-agent safe method for assigning focus to an element. It handles elements that may be hidden in collapsible panels or tab elements and manages hash changes in the URL to ensure that focus is correctly assigned even after a page load or hash change.
The component defines the following event:
- setfocus.wb: Triggered to assign focus to an element. It opens any closed ancestor elements if necessary and ensures the element is focusable before setting the focus.
It is used in the following components:
- Footnotes
- Formvalid
- Lightbox
- Menu
- Overlay
- Paginate
- Tabs
- Toggle
- X / Twitter
- Datalist polyfill (auto-complete)
- Input type="date" polyfill (date picker)
Page details
- Date modified: