Get a notification when a user starts and stops typing on the passed-in `el`.
✓ Published0🌍 Public
Aakre54
Last edited Apr 3, 2015
Created on Apr 3, 2015
This example demonstrates a utility for detecting when a user begins and ends typing in a given DOM element, triggering custom `start` and `stop` callback functions. It uses the native `addEventListener` API to listen for `keypress`, `keydown`, and `keyup` events, distinguishing backspace and delete keys from regular input. A configurable `delay` (defaulting to 400ms) controls the idle period before the `stop` notification fires, and the code avoids repeated `start` calls while typing continues. Written in CoffeeScript, the module exports a function that accepts the element and an options object.
AI-generated description