Nerian / bootstrap-datepicker-rails

A Datepicker for Twitter Bootstrap, integrated with Rails assets pipeline
MIT License
648 stars 182 forks source link

Datepicker not showing up sometimes. #132

Closed alator21 closed 6 years ago

alator21 commented 7 years ago

Datepicker works sometimes and sometimes dont.

          <div class="form-group">
             <label >Date:</label>
             <%= f.text_field(:date, class: "datepicker form-control") %>
          </div>

I got a function to change some other field according to the value of the datepicker $(document).ready(function(){ $('.datepicker').datepicker(); //... //..... $(document).on('change','.datepicker',function(){ //..... }) }) When i click on the field for the first time everything works OK.the panel is showing up and i choose the date.Then when i submit my form and come to create a new object ,i click on the text field and nothing showing up.If i refresh at this point everything works again etc. Any clues?

Nerian commented 6 years ago

Did you figure this out? It may be related to Turbolinks, if you are using it.