-
Notifications
You must be signed in to change notification settings - Fork 0
Accessibility issue when using Input with a prefix or suffix #131
Comments
I've had a quick look at this and the following JSX:
yields this HTML:
Which looks fine to me. The label is associated with the input with the for/id combination. Label / input association isn't affected by being in the same div or not. Can you give a bit more detail on what you're seeing? It's a little hard to comment without an example of your issue. What JSX are you using and what HTML does it give? What specifically is wrong with it? |
Could you paste the JSX that you're using too? |
Looking at your code - you don't have an id on the input actually, and you're getting things like I wonder whether I should be doing something with this, like outputting a console error if required things are missing 🤔 |
Thank you for solving it! I have added an |
Ah excellent, I'm glad that sorted it for you. Out of interest - would you have liked to receive notification somehow that this was the issue? Perhaps a console error or warning? I'm thinking an error - the resultant html is basically malformed and you wouldn't want to ship it to produciton like that. |
Yes, I guess I would have liked to have received a console warning or error so I didn't post my 'issue'. |
Thanks @dave1976wilson. I've logged this as #133 |
When using a prefix or suffix on an Input component the label element is not rendered within the same div as the input element and therefore it fails an accessibility check - 'Form elements do not have associated labels'.
The text was updated successfully, but these errors were encountered: