FocusCaptureMixin

Allows Tab and Shift+Tab operations to cycle the focus within the component

Overview

This mixin expects the component to provide:

  • A template-stamping mechanism compatible with ShadowTemplateMixin.

The mixin provides these features to the component:

  • Template elements and event handlers that will cause the keyboard focus to wrap.

This mixin contributes to a component's template. See that discussion for details on how to use such a mixin.

API

wrap(original) method

Destructively wrap a node with elements necessary to capture focus.

Call this method in a components symbols.template property. Invoke this method as this[FocusCaptureMixin.wrap](element).

Parameters:

  • original: Nodethe element within which focus should wrap