pryley / float-labels.js

A zero-dependency plugin that applies the float label pattern to a form.
https://pryley.github.io/float-labels.js/
MIT License
88 stars 22 forks source link

float-labels.js plugin and datepicker #33

Closed wagnerfillio closed 5 years ago

wagnerfillio commented 5 years ago

I am using a field in the format datepicker.

When you manually enter a date, it works fine.

But when using select a date by datepicker, the label does not work.

data

pryley commented 5 years ago

Float Labels listens for the standard input event to detect changes. If the datepicker package you are using does not trigger the input event on change, then you will need to handle this yourself by either triggering the input event or rebuilding float-labels on datepicker change.

wagnerfillio commented 5 years ago

Ah some way to change the default input to detect changes?

Change to click event?

For example: It would be necessary to click inside the field to activate the floating label.

I believe that I could change these three functions:

onBlur_, onInput_ and onFocus_

pryley commented 5 years ago

I suggest you search the issues (open and closed) on the datepicker github as there is likely a similar issue there.