angular-actual-input-event-manager-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Actual input event manager plugin for Angular

Internet Explorer 10+ implements 'input' event but it erroneously fires under various situations, e.g. when placeholder changes, or a control is focused. Link to issue.

This plugin prevents an otherwise pristine field from being dirtied in this cases.

Usage:

  1. npm install angular-actual-input-event-manager-plugin
    import { ACTUAL_INPUT_EVENT_MANAGER_PLUGIN_PROVIDER } from 'angular-actual-input-event-manager-plugin';
    ...
    @NgModule({
        ...
        providers: [
            ...
            ACTUAL_INPUT_EVENT_MANAGER_PLUGIN_PROVIDER,
        ],
    })
    export class CoreModule { ... }

Recommendation:

Provide this plugin only for Internet Explorer 10+, e.g. using User-Agent string parser.

    import { UAParser } from 'ua-parser-js';
    import { ACTUAL_INPUT_EVENT_MANAGER_PLUGIN_PROVIDER } from 'angular-actual-input-event-manager-plugin';
    ...
    const browser = (new UAParser()).getBrowser();
    @NgModule({
        ...
        providers: [
            ...
            browser.name === 'IE' && parseInt(browser.version, 10) <= 11 
                ? [ACTUAL_INPUT_EVENT_MANAGER_PLUGIN_PROVIDER]
                : [],
        ],
    })
    export class CoreModule { ... }

Package Sidebar

Install

npm i angular-actual-input-event-manager-plugin

Weekly Downloads

1

Version

1.0.1

License

ISC

Last publish

Collaborators

  • 14k