Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
massic80 opened this issue Feb 21, 2018 · 0 comments
Open

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

massic80 opened this issue Feb 21, 2018 · 0 comments

Comments

@massic80
Copy link

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?

@massic80 massic80 changed the title When loaded ad AMD module, it's triggered everywhere When loaded as AMD module, it's triggered everywhere Feb 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant