Skip to content

When loaded as AMD module, it's triggered everywhere #59

@massic80

Description

@massic80

Hi all,
I am working on a project based on requireJS and I'm trying to load NDIP only when a date input is present in page.
if(document.querySelector("input[type='date']")!==null) require(["libs/nodep-date-input-polyfill.dist"]);
The problem is: the polyfill is triggered whichever browser I use, duplicating the native behavior.
No problem if I hardcode the script in my page, prior the removal of ('function'==typeof define&&define.amd?define(b): which would trigger a requirejs error). Firefox would show the native interface, IE11 would show the polyfill.
Can you reproduce this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions