Hello everyone) I ask for help. There is a bug. We have a form (input text), a datepicker (bootstrap-datapicker) is hung up on the class using jquery. It is called and works. All OK. If you select a date, and then click on the field again, the datapicker will reappear and the date can be changed. But if at the moment when the datapicker is activated, just click where on the side of any element. THEN, then when you click again on the input, the datapicker does not open the first time. You need to click on the neighboring input for example, and then again on the desired input. Has anyone come across?

<form class="form-horizontal right-form"> <div class="form-group"> <label for="inputWhen" class="col-sm-2 control-label tuda">Туда</label> <div class="col-sm-10"> <input type="text" readonly style="cursor: pointer;" class="form-control datepicker" id="inputWhen"> </div> </div> <div class="form-group"> <div class="checker squaredFour"> <label> <input class="checkbox checkdva" type="checkbox" name="checkbox-test" data-class="js-a"> <span class="checkbox-custom"></span> </label> </div> <label for="inputReturn" class="col-sm-2 control-label obratno">Обратно</label> <div class="col-sm-10"> <input type="text" readonly style="cursor: pointer;" class="form-control datepicker js-all js-a" id="inputReturn" disabled> </div> </div> <a class="button-link-ticket" href="#"><div class="button-ticket">НАЙТИ БИЛЕТЫ</div></a> </form> 

Above html, and the datepicker is called via jquery

  $('#inputWhen').datepicker({ autoclose: true, format: "dd/mm/yyyy", weekStart: 1, maxViewMode: 2, todayBtn: "linked", language: "ru", orientation: "top auto", toggleActive: false }); $('#inputReturn').datepicker({ autoclose: true, format: "dd/mm/yyyy", weekStart: 1, maxViewMode: 2, todayBtn: "linked", language: "ru", orientation: "top auto", toggleActive: false }); 
  • Checked with datepicker 1.7.1 within the specified code, everything works - tutankhamun
  • exactly my problem? The datapicker itself works. The only problem is that the repeated call of the piker does not work on the first click, if before that it clicked on another area or scrolled the screen. - Alex Sorokin
  • So the problem is in the JS-code that you did not show - tutankhamun
  • And you can tell what can be done .. in general, I noticed that if you click on any other element, and then again on the input, then everything works fine. It turns out that you need to change the "active" element. And if you press the input all the time, the function call does not occur again. Can you tell me. To write some function so that, for example, when the datapicker disappears (becomes inactive), a "class update" occurs or something like that. I understand that I formulated it abstractly, but you probably understood me. Thank. - Alex Sorokin
  • Look at the code and in the "tools" which handlers hang on these inputs - tutankhamun

0