Skip to content
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

Closed
zirkler opened this issue Apr 16, 2014 · 7 comments
Closed

Offset on Date Input #1147

zirkler opened this issue Apr 16, 2014 · 7 comments
Assignees

Comments

@zirkler
Copy link

zirkler commented Apr 16, 2014

On type="date" you can see a offset and this very dark datepicker.

ios-simulator_-iphone_retina__3_5-inch____ios_7_0_3__11b508

here is an example: http://codepen.io/anon/pen/cvlzA/

I am also wondering how to set the placeholder for date inputs?

Thank You.

@MattTheRed
Copy link

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.

@zirkler
Copy link
Author

zirkler commented Apr 17, 2014

has anybody done this placeholder overlay thing before?

@MattTheRed
Copy link

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;
          }

        }
    }
}]);

@ajoslin
Copy link
Contributor

ajoslin commented Apr 29, 2014

Can you try this in beta.2?

@MattTheRed
Copy link

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

@zirkler
Copy link
Author

zirkler commented Apr 30, 2014

Hello,

I am getting this:

ios-simulator_-iphone_retina__3_5-inch____ios_7_0_3__11b508

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 6, 2018

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants