Event reference
Every event fireEvent has a method for, and the template binding each one runs.
Each method takes the element and an optional init object. It runs the element's (bind*) or (catch*) handler. Touch, mouse and key events then go up to the page, as on a device, until a (catch*) handler or a handler that calls $event.stopPropagation() stops them. The other events stay on the element, as do mouseenter and mouseleave.
As on a device, every (global-bind*) handler for the event runs first, wherever it is in the page. They're how document: and window: listeners hear touches, so those run too, after the elements' handlers. One that a (catch*) handler stopped reaches them on the next timer:
$event.target is the element, as a device names it: { uid }, its unique id.
Touch
Mouse and keyboard
Scrolling
Coming into view
A device sends uiappear when an element comes into view, and uidisappear when it leaves. The lynxExposure directive and IntersectionObserver listen for them, so firing one is how a test scrolls an element into view. An IntersectionObserver given a threshold, rootMargin, scrollMargin or root sees all of the element come in (an intersectionRatio of 1) and all of it leave, as there's no layout to measure in a test:
Forms and focus
A focused <input> or <textarea> fires keyboardheightchange as the keyboard shows, changes size and hides. Pass its height as detail.height, and 0 for a keyboard that went away:
Accessibility
A screen reader user picking one of an element's accessibility-actions fires accessibilityaction, with the action's name in detail.name:
Overlays
Android's back button fires requestclose at an open <overlay>, which has no detail.
Layout and loading
An <image>, <svg>, <frame> or <webview> fires load once its content arrives, and an <image>, <video>, <webview> or <overlay> fires error when it fails. Pass what the element would report as detail, such as an image's size:
Animations and transitions
Other events
For an event without a method, create it yourself. Its type is the binding's event type and the event name, joined by a colon:
A CustomEvent's detail reaches the handler as $event.detail. A <viewpager> that moved to its third page:
