When I do
$('#date').datepicker({
container: 'body'
})
I'm having an error in the console:
Uncaught RangeError: Maximum call stack size exceeded.
at Modal._handleFocus (materialize.js?body=1:3004)
If you select several times, then this happens endlessly
What to do?
Example (Be careful, get ready to close the window, fills up memory)
Using this code will get it working: ( I will work on why container: 'body' causes a bug later)
$(document).ready(function(){
$('.modal').modal();
$('.datepicker').datepicker({
})
});
However, the datepicker is too small to interact with. The datepicker itself is a modal. So basically the modal opens another modal. The datepicker fills the container it is in, in this case the modal. So it will appear small.
By default the datepicker will be placed before the input. If you do not pick container. I think you picked container body to make it fill the screen. However, after a little investigation the modal has a has focus event issue.
Do you need the datepicker in a modal? I will try to investigate more and help.
There only seems to be hacker type things you can do for the moment.
https://codepen.io/anon/pen/wjdbBY
Fixed in 1.0.0-rc.1 https://codepen.io/Dogfalo/pen/mLmZBb
Most helpful comment
Fixed in 1.0.0-rc.1 https://codepen.io/Dogfalo/pen/mLmZBb