React-dates: Inputs cannot be labeled

Created on 9 Nov 2017  路  3Comments  路  Source: airbnb/react-dates

Hello.

Is there some way I can label the inputs in the DateRangePicker? I do not have the flexibility to add a custom label to the inputs.

If you like, I can open a PR myself to get this done.

Thanks,
Jes煤s

Most helpful comment

I actually kind of thing it would be a great idea to add a visible label to the inputs (and maybe add an option to hide them and have an invisible but accessible label as well).

We should def be encouraging the positive a11y practice of visible labels! Placeholders do not count as labels... no matter how much we want them to. :P

All 3 comments

@Jesus-Gonzalez we have had a similar issue. One alternative option for you is to assemble your own DatePicker using the exported components. For example, instead of importing DateRangePicker, import DayPickerRangeController and build your own inputs.

@timhwang21 thanks, I will try that :slightly_smiling_face:

I actually kind of thing it would be a great idea to add a visible label to the inputs (and maybe add an option to hide them and have an invisible but accessible label as well).

We should def be encouraging the positive a11y practice of visible labels! Placeholders do not count as labels... no matter how much we want them to. :P

Was this page helpful?
0 / 5 - 0 ratings