Skip to content
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.

Editable datepicker #502

Open
angex opened this issue Jun 13, 2017 · 6 comments
Open

Editable datepicker #502

angex opened this issue Jun 13, 2017 · 6 comments

Comments

@angex
Copy link

angex commented Jun 13, 2017

Is there an option to set uif-datepicker editable?

@andrewconnell
Copy link
Member

Not sure I know what you mean... all controls by their nature are usable / editable.

@angex
Copy link
Author

angex commented Jun 15, 2017

I mean typing in the date with keyboard. Keyboard input is disabled and I don't find option for enabling it for this control.

@andrewconnell
Copy link
Member

Unfortunately not... Office UI Fabric took a dependency on http://amsul.ca/pickadate.js/ to implement this control which applies to us as well. Doesn't appear it supports manually entering the date so unfortunately, we can't do that at this time.

@angex
Copy link
Author

angex commented Jun 15, 2017

amsul has editable: true
This prevents popup from opening but it can be overridden:
amsul/pickadate.js#542

@andrewconnell andrewconnell reopened this Jun 15, 2017
@andrewconnell
Copy link
Member

I stand corrected... warrants additional research to see if this is supported as the issue on their repo is open and only resolved by a fork... which we aren't based on... so not sure if the underlying version of the library supports it.

@architshukla
Copy link
Contributor

It seems to be supported by the library and there is an example at http://amsul.ca/pickadate.js/date/#editable. I've also checked that setting editable: true in the existing directive prevents the picker from launching.

The change would require conditionally applying a change/focusout listener on the input field. I can prepare a PR for this if no one else is working on it.

As my local changes stand at this moment, I am converting the input value to a Date and this means an empty or invalid date returns the current date. Let me know if this is not acceptable and we can discuss alternatives.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants