-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offset on Date Input #1147
Comments
With an input type="date", you cannot set a placeholder value. You could overlay of a label that looks like a placeholder on top of the input while its unfocused & empty and the hide it when the user focuses on the input or it goes back to blank. |
has anybody done this placeholder overlay thing before? |
Try this: http://plnkr.co/edit/6uOF1V?p=preview app.directive("datePicker", ["$document", function ($document) {
return {
restrict: "E",
scope: {
placeholder: '@',
date: "="
},
template: '<input type="text" placeholder="{{placeholder}}" ng-focus="toggleDate()" ng-hide="showDateInput"><input type="date" ng-show="showDateInput">',
link: function (scope, element) {
scope.showDateInput = false;
scope.toggleDate = function (){
scope.showDateInput = !scope.showDateInput;
}
}
}
}]); |
Can you try this in beta.2? |
Not sure if you meant me or TheJetLag, but looks like the directive works fine in beta.2, http://plnkr.co/edit/6uOF1V?p=preview |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
On
type="date"
you can see a offset and this very dark datepicker.here is an example: http://codepen.io/anon/pen/cvlzA/
I am also wondering how to set the placeholder for date inputs?
Thank You.
The text was updated successfully, but these errors were encountered: