npm.io
0.1.8 • Published 6 years ago

@vaadin/active-state-mixin

Licence
Apache-2.0
Version
0.1.8
Deps
6
Size
18 kB
Vulns
0
Weekly
0
Stars
7

@vaadin/active-state-mixin

This package provides ActiveStateMixin that does the following:

  1. Listen to keyboard, mouse and touch events on the host element

  2. Set active attribute on the host element in following cases:

  • Element has disabled property set to false
  • Mouse: primary (left) button is pressed
  • Keyboard: Enter or Space is pressed
  1. Remove active attribute when mouse / key / touch is released.

The mixin accepts a class that must apply DisabledStateMixin.