React-date-picker: Support Custom Input

Created on 31 Jan 2018  路  6Comments  路  Source: wojtekmaj/react-date-picker

Hi,

Was wondering if there is appetite for a "customInput" property the same as in another project react-datepicker

This would allow for custom input boxes... for example integration with rmwc input boxes, etc.

If you think this is good, I will develop a PR for you

Thanks,
~ B

enhancement

Most helpful comment

@bhldev I needed an implementation using a single input that functioned like a regular input (onFocus/Blur/Change) etc. This allows users to easily edit dates without changing inputs and responds to all regular input events.

https://gist.github.com/kpheasey/64fc79c656eede81fb4d651ebac70600

screen shot 2018-04-09 at 1 09 10 pm

All 6 comments

Hmmm... I'm okay with the idea, don't know what the community thinks about it. Anyway, with custom input, not much of the original react-date-picker is left - actually only the logic behind opening and closing the calendar. If there's a demand for that though I don't see a reason why not to.

@bhldev I needed an implementation using a single input that functioned like a regular input (onFocus/Blur/Change) etc. This allows users to easily edit dates without changing inputs and responds to all regular input events.

https://gist.github.com/kpheasey/64fc79c656eede81fb4d651ebac70600

screen shot 2018-04-09 at 1 09 10 pm

By the way, users don't need to change between the inputs to put the whole date in. If the date is separated by ., they can just press . and they will be in the next field. Arrow keys should work as well.

Probably in your case it can be also good to just un-hide the native input that is there for accessibility reasons, and hide the custom ones. That could work on modern browsers. But you'll need to use appearance: textfield to overwrite its default UI.

I actually need this feature right now

I need this feature, the existing input is not customizable enough

when will the new version with this feature be published?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

podlesny picture podlesny  路  7Comments

BaherZ picture BaherZ  路  8Comments

leo-iomer picture leo-iomer  路  8Comments

baffleinc picture baffleinc  路  4Comments

RubberChickenParadise picture RubberChickenParadise  路  6Comments