Materialize: Datepicker modal won't appear on IE 11 [v.1.0.0]

Created on 18 Dec 2017  路  2Comments  路  Source: Dogfalo/materialize

[Materialize 1.0.0-alpha.2]

IE 11 won't show up 'datepicker' modal.
I clicked input field, but nothing happened (even no errors or warnings!).

Other browsers are just fine.

Here is my code

  • HTML5
...
<form method="post" action="">
    <div class="row">
        <div class="input-field col s12">
            <input type="text" class="datepicker validate" id="date_picker" name="date_picker" placeholder="Choose a date" />
            <label for="date_picker">Pick a date</label>
        </div>
    </div>
</form>
...
  • JS (using jQuery 3.2.1)
$(document).ready(function(){
    $('.datepicker').datepicker();
});

1.0 docs' example also doesn't work on ie 11...

Need help.

Most helpful comment

Fixed in 7c4fc588f5ae3d4d3e838354ab5195905a2a4184

All 2 comments

This error is thrown at line 11208 of materialize.js

this.wrapper = document.createElement('div');
this.wrapper.classList.add();

On Chrome/FF this creates an element of the shape <div class></div> but on IE11 the error Argument not optional is thrown. I am assuming this is not intentional because I can't think of a reason to call classList.add() without arguments. Immediately after it is called, $(this.wrapper).addClass('select-wrapper') is called which essentially makes the previous line a null operation.

If the line this.wrapper.classList.add() is removed the code would (probably?) behave the same way. Ideally, this is an easy fix and I'm happy to make a PR

Of course, I could totally be wrong and if I am I'm sorry I'm just trying to help 馃槃 @acburst @Dogfalo

Fixed in 7c4fc588f5ae3d4d3e838354ab5195905a2a4184

Was this page helpful?
0 / 5 - 0 ratings

Related issues

locomain picture locomain  路  3Comments

ruslandzhumaev picture ruslandzhumaev  路  3Comments

cope picture cope  路  3Comments

ReiiYuki picture ReiiYuki  路  3Comments

MickaelH974 picture MickaelH974  路  3Comments