Skip to content
aurelia plugin for long-click event
JavaScript TypeScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


aurelia plugin for long-click event.

License: MIT Issues

NPMVersion NPMDownloads NPMSize

Total alerts Language grade: JavaScript DeepScan grade

How to Use

install the plugin using yarn or npm.

yarn add aurelia-long-click-event
npm install aurelia-long-click-event

initialize the plugin in your main.js or main.ts.

  import { PLATFORM } from "aurelia-pal";

+    .plugin(PLATFORM.moduleName("aurelia-long-click-event"));

you can pass optional configuration to control the name of the long-click event (defaults to "long-click"), and the click duration (defaults to 500 ms).

  import { LongClickConfig } from "aurelia-long-click-event"; // (TS users can use this interface for strongly typed config)
    .plugin(PLATFORM.moduleName("aurelia-long-click-event"), { longClickEventName: "long-click", clickDurationMS: 500 });

now you can register callbacks to the event just like any regular event (using trigger or delegate)

<button long-click.delegate="longClick()">long click me</button>

plugin was build using:

How to build and run sample

  • npm run watch

    • Launches sample and watches src folder
    • it does the type-checking and ts-lints on every save
    • open http://localhost:4444 to see the plugin in action.
  • npm run build

    • Produces amd/commonjs/system/es2015 builds
    • This will NOT emit/update files if you have any typescript or tslint errors

I Need help regarding how to test the plugin - PR welcome

How to run unit tests

  • To run the unit test with Jest run : npm run test:unit
    • Watch mode: npm run test:unit -- --watch
    • See the coverage: npm run test:unit -- --coverage

How to run E2E tests

  • Simply run: npm run test:e2e
    • Make sure you've run the sample prior to the e2e test by running the npm watch command.
You can’t perform that action at this time.