3

I'm working on bug requests for an jQuery Mobile/HTML5 app on Blackberry 10. One of the bugs reported only seems to manifest on the BB10. The bug report is that the datepicker sometimes doesn't show up when the date field (input type=date) is tapped.

After experimenting with this for a while, it appears that, on the BB10, the date picker isn't triggered by the date field having focus, but rather by the the user 'tapping' the field -- and that tap seems to have a bit of time sensitivity.

As an example: if I use jQuery Mobile's "clear button", like so:

<input type="date" name="my-field" value="" data-clear-btn="true" autocorrect="off"
       autocapitalize="off" />

I can easily create a scenario where I provide a date and then hit the clear button. The net result is that the date field has focus, but the date picker doesn't automatically appear. Once the form state is like this, it's pretty easy to get the problematic behaviour -- tap and nothing happens.

As I said, above, there seems to be a bit of time sensitivity to the tapping. When trying to give that field focus, some people seem to tap fairly quickly -- jQuery seems to notice the tap and does its magic to apply the "ui-focus" style, but it's still seems to be too quick to get the date picker to intervene. So far, every time I've held my finger down for a full second, I've always had the date picker pop up, but my usual tapping speed is a bit too fast to trigger the date picker (and the QA people certainly seem to have tripped on this a number of times).

My question, then, is: Is there anything I can do about this? Is there an event I can fire on focus that'll trigger the datepicker? Or some kind of configuration I can fiddle with?

I fear that the answer is probably "no" but I wanted to ask.

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
bcholmes
  • 944
  • 1
  • 9
  • 23
  • if you bind `focus` to datepicker, does it fire? – Omar Feb 11 '14 at 22:55
  • I'm not quite sure I understand your question -- the date picker is the BB10's native date picker, so I'm not manually binding anything to get the datepicker to show. Instead, I'm identifying the field as a date and the datepicker launches once the field is tapped. – bcholmes Feb 12 '14 at 14:47
  • 1
    I mean if you `$("#datePicker").trigger("focus");` what happens on BB10? – Omar Feb 12 '14 at 15:05
  • Yeah, we tried manually triggering a focus event on the input field, and it didn't work -- it didn't launch the date picker. We also tried the click event. Thanks for the suggestion, though. – bcholmes Feb 12 '14 at 15:37
  • if you're using select menus, are you facing the same? – Omar Feb 12 '14 at 15:48
  • 1
    I am facing the same issue. I triggered the 'focus' via debug console, and it opens, and - since I use parsley.js to validate the form, and parsley.js binds focus on input fields which are not valid - if I submit the form without setting a date the picker appears. I also noticed that, once the picker has appeared once, than the response is immediate, it's to say that after the first time, the other times the picker is launched every time I tap the field. – Simona Adriani Jun 17 '14 at 13:44

0 Answers0