-
Notifications
You must be signed in to change notification settings - Fork 139
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
Datepicker throws error in IE11 #60
Comments
@pchristou Are you able to try it out with a simple MaterializeCSS import (no angular or wrapper) ? Just to confirm the problem is in the wrapper and not in MaterializeCSS itself. Here's how you'd import the vanilla MaterializeCSS: <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/css/materialize.min.css">
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/js/materialize.min.js"></script> |
@rubyboy vanilla materialize works. You can see there's no errors upon selecting a date. |
I found the problem. Working on it (something to do with dispatching events in IE - it doesn't like the |
Yeah, working this Polyfill into a TypeScript style: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent |
A fix has been released. I've tested and also released a new version to http://angular2-materialize.surge.sh and it seems to work fine on IE11 now. |
@rubyboy demo seems fine now. I included the 1 additional file and modified the materialize-directive.ts file in my own project then rebuilt and run the solution but it's still erroring. Anything else I need to do that I may be missing? Thanks for the quick turnaround on this. |
Sorry for not answering. Going on holidays :) |
Yep, all working. Have a good holiday! On Tuesday, 12 July 2016, rubyboy notifications@github.com wrote:
|
Hello... jQueryElement.on("change", e => nativeElement.dispatchEvent(new CustomEvent("input"))); |
Me too. I ignore it in my project. |
I can not run your app. for testing there is tsc errors: [01:35:47] Starting 'tsc'... |
you can change custom-event-polyfill.ts: function CustomEvent(type, bubbles, cancelable, detail) { and use exported createCustomEvent |
i change it by: `function CustomEvent(type: string, eventInitDict?: CustomEventInit) { if ("Event" in window) { export function createCustomEvent(type: string, eventInitDict: CustomEventInit = { bubbles: false, cancelable: false, detail: undefined }): CustomEvent { |
Datepicker throws error in IE11 InfomediaLtd#60
Fix for Datepicker throws error in IE11 InfomediaLtd#60
Hi,
This may be linked to issue #58 but IE11 throws up an error upon the user selecting a date (or clicking any other buttons in the date widget). The error seems somewhat generic so is difficult to track down to a specific line... Note that the functionality still works but the same error is not thrown in Firefox or Chrome.
The markup I'm using is simply
<input type="date" materialize="pickadate" class="datepicker">
Error that's thrown on selection / clear (highlighted line in image changes depending on whether the key pressed was a selection or clear command)
The text was updated successfully, but these errors were encountered: