-
Notifications
You must be signed in to change notification settings - Fork 41
Switch input labels to use <label> element #87
Comments
I think it's time we create a |
@hharnisc agreed :) Do you have any ideas around creating unique id's to pass to the id tag? |
@emily-plummer taking a quick look at the http://redux-form.com/6.8.0/ docs I think we get some help there 😄 |
So with each unique name: https://github.com/bufferapp/buffer-web-components/blob/master/DateTimeForm/index.jsx#L47 unique form: https://github.com/bufferapp/buffer-web-components/blob/master/DateTimeForm/index.jsx#L88 I'm expecting it to be easy to grab the Does |
@hharnisc I don't think so, the
and then the label component would look like this:
That would get around needing to grab an id for each input & would ensure that every input has a label! We can also pass an option |
Seems like a great idea to always have a label (visible or otherwise!). Pretty cool that the label can be associated with the input with nesting too! I think it will keep things simpler if we use the |
Heya @hharnisc @alvarezmelissa87 @stevemdixon!
Just a heads up on an axe-core error I'm seeing while adding the tests - it looks like we're using a div element for the input labels instead of a
<label>
I wonder if instead of using a
<Text>
component for this we could use the native<label>
component? That way screen readers have an easier time knowing which label is associated to which input.Here's an example of how we might do that:
The only thing tricky about this is that I believe we'll need a unique id for each instance of the input in order to associate the label with a particular
<input>
The text was updated successfully, but these errors were encountered: