When using the altInput option, an alternative field is added to display a human-readable date.
The alternative field doesn't have an id. By giving the altInput field an id, a label can be associated with the altInput field. Now when the user clicks the label, the calendar opens.
Hello,
You don't need id and for to associate an input with a label.
Consider omitting those for calendar inputs.
I don't think this particular issue warrants extra code.
But thank you for contributing regardless :+1:
I must ask you to reconsider, @chmln.
Association between label and input is important. Besides being super convenient for regular users (click label, go to field), it's imperative for a good screenreader experience.
There are a couple of ways to associate labels with inputs:
for-attributeAnd there are a couple of ways to set a label on an input:
title-attributearia-label attributeYou don't need
idandforto associate an input with a label.
With above statement, you seem to favor the former. That is fine. But with all respect, you can't expect everyone to follow your standards. There are valid use-cases for each of the above. Flatpickr currently doesn't provide any means to associate the altInput with a label, which is inconvenient for regular users and very confusing for users that depend on screenreaders. Don't neglect them.
With just 6 LOC, Flatpickr gets support for at least one strategy. Please do reconsider.
Bump. This is currently breaking our screen reader accessibility. Would be great to had support for passing in an HTML ID
Most helpful comment
I must ask you to reconsider, @chmln.
Association between label and input is important. Besides being super convenient for regular users (click label, go to field), it's imperative for a good screenreader experience.
There are a couple of ways to associate labels with inputs:
for-attributeAnd there are a couple of ways to set a label on an input:
title-attributearia-labelattributeWith above statement, you seem to favor the former. That is fine. But with all respect, you can't expect everyone to follow your standards. There are valid use-cases for each of the above. Flatpickr currently doesn't provide any means to associate the
altInputwith a label, which is inconvenient for regular users and very confusing for users that depend on screenreaders. Don't neglect them.With just 6 LOC, Flatpickr gets support for at least one strategy. Please do reconsider.