Dogfalo / materialize

Materialize, a CSS Framework based on Material Design
https://materializecss.com
MIT License
38.87k stars 4.74k forks source link

datepicker within side nav #2439

Closed manquer closed 8 years ago

manquer commented 8 years ago

Date picker is not visible if the input element is within a side nav list

Dogfalo commented 8 years ago

Have you looked at the date picker container option? On Dec 7, 2015 9:43 AM, "Manquer" notifications@github.com wrote:

Date picker is not visible if the input element is within a side nav list

— Reply to this email directly or view it on GitHub https://github.com/Dogfalo/materialize/issues/2439.

manquer commented 8 years ago

Thank you :) the container options worked. Since I believe you have already customized and modified the original plugin, perhaps you can set this automatically as default for such elements?

Also it would be helpful if there is a link in the documentation to the docs page,

solo14000 commented 8 years ago

Hello,

I have the same problem with datepicker not displaying within a side nav list. Could you explain a little more your answer about 'the container option'?

Thanks

CatalinRadoi commented 3 years ago

If you don't initialize the picker with jQuery, you may set some options.... One of these options is the "container"

var dateElems = document.querySelectorAll('.datepicker');

var options = {
    autoClose: true,
    showClearBtn: false,
    firstDay: 1,
    selectMonths: true,
    selectYears: 2,
    setDefaultDate: true,
    container: "body",
    i18n: {
        months: months,
        monthsShort: monthsShort,
        weekdays: weekdays,
        weekdaysShort: weekdaysShort,
        weekdaysAbbrev: weekdaysAbbrev,
        today: today,
        clear: clear,
        close: close
    }
};

M.Datepicker.init(dateElems, options);