Skip to content
This repository
Browse code

Update Android/DatePicker/README.md

Use focus() event on time field and add the blur(). On iPhone, we 
needed the blur() because otherwise the standard form element editor
stayed live after you closed the date picker.
  • Loading branch information...
commit 64da10a85e0fb2c0b07703ec1df97a108140d8b9 1 parent 4f024a1
Robert (Jamie) Munro rjmunro authored

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. +4 2 Android/DatePicker/README.md
6 Android/DatePicker/README.md
Source Rendered
@@ -21,13 +21,13 @@
21 21 }, function(returnDate) {
22 22 var newDate = new Date(returnDate);
23 23 currentField.val(newDate.toString("dd/MMM/yyyy"));
24   -
  24 +
25 25 // This fixes the problem you mention at the bottom of this script with it not working a second/third time around, because it is in focus.
26 26 currentField.blur();
27 27 });
28 28 });
29 29
30   - $('.nativetimepicker').click(function(event) {
  30 + $('.nativetimepicker').focus(function(event) {
31 31 var currentField = $(this);
32 32 var time = currentField.val();
33 33 var myNewTime = new Date();
@@ -44,6 +44,8 @@
44 44 // returnDate is generated by .toLocaleString() in Java so it will be relative to the current time zone
45 45 var newDate = new Date(returnDate);
46 46 currentField.val(newDate.toString("HH:mm"));
  47 +
  48 + currentField.blur();
47 49 });
48 50 });
49 51 ```

0 comments on commit 64da10a

Please sign in to comment.
Something went wrong with that request. Please try again.