@simulacron/events

1.0.0 • Public • Published

LitWidget conditional events helpers

Helper functions for LitWidget conditional events.

  • keydown() - keydown event helper;
  • keyup() - keyup event helper;
  • keypress() - keypress event helper.

You can specify one or more keyboard shortcuts:

class SampleWidget extends LitWidget {

  @onEvent('search-field', keydown('esc'))
  cancel(event) {
    ...
  }

  // or

  @onEvent('search-field', keydown(['esc', 'ctrl+k']))
  cancel(event) {
    ...
  }

}

For the keyboard shortcut format, see KeyboardShortcuts.

Package Sidebar

Install

npm i @simulacron/events

Weekly Downloads

0

Version

1.0.0

License

BSD-3-Clause

Unpacked Size

5.15 kB

Total Files

5

Last publish

Collaborators

  • andyduke