Skip to main content

UserFocusController

Purpose

A utility controller to wire up other stimulus actions when the user is active on a page, and when the page gets minimised/loses focus.

Actions

ActionPurpose
--

Targets

TargetPurposeDefault
---

Classes

ClassPurposeDefault
---

Values

ValueTypeDescriptionDefault
----

Events

EventWhenDispatched onevent.detail
user-focus:activeWhen the user becomes active on the pagethe controller root element-
user-focus:awayWhen the page gets minimized or loses focusthe controller root element-

Side Effects

The controller will install event listeners for:

Window:

  • focus
  • blur

Document:

  • visibilitychange

How to Use