Permalink
Browse files

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...
1 parent 4f024a1 commit 64da10a85e0fb2c0b07703ec1df97a108140d8b9 @rjmunro rjmunro committed Sep 20, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 Android/DatePicker/README.md
View
6 Android/DatePicker/README.md
@@ -21,13 +21,13 @@
}, function(returnDate) {
var newDate = new Date(returnDate);
currentField.val(newDate.toString("dd/MMM/yyyy"));
-
+
// 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.
currentField.blur();
});
});
- $('.nativetimepicker').click(function(event) {
+ $('.nativetimepicker').focus(function(event) {
var currentField = $(this);
var time = currentField.val();
var myNewTime = new Date();
@@ -44,6 +44,8 @@
// returnDate is generated by .toLocaleString() in Java so it will be relative to the current time zone
var newDate = new Date(returnDate);
currentField.val(newDate.toString("HH:mm"));
+
+ currentField.blur();
});
});
```

0 comments on commit 64da10a

Please sign in to comment.