muicss / mui

Lightweight CSS framework
https://www.muicss.com
Other
4.51k stars 426 forks source link

Label elements do not have for attribute [React] #243

Closed ivanwolf closed 6 years ago

ivanwolf commented 6 years ago

I'm building a PWA using the react components. The Lighthouse Report complains when Form elements do not have associated labels. The reason is here. I checked the TextInput source code and noticed that the required attribute is not being passed. Should I do a PR? This is my first ever Issue on any public project I hope it is useful. Thanks in advance

amorey commented 6 years ago

Sorry for the late reply! I've been busy with a new baby. Can you show the Lighthouse Report error message you're getting?

amorey commented 6 years ago

@ivanwolf15 Did you consider filling in the input id field and the label htmlFor field automatically so the developer doesn't have to supply a labelFor value?

ivanwolf commented 6 years ago

Here is the message screen shot 2017-11-14 at 10 08 26 And is a better idea what you say, i doing it in #244

amorey commented 6 years ago

Thanks for sharing a copy of the message! Will you create a new pull request with the automatic id/htmlFor behavior?

ivanwolf commented 6 years ago

In a minute

ivanwolf commented 6 years ago

@amorey I saw that the changes I made are on the branch ondeck. Should I close the PR? And thanks for attending the issue!

amorey commented 6 years ago

That's ok, the PR should close automatically when I merge into the master (soon). If you want to start using it you can run npm run build-packages in the ondeck branch and install the npm package in packages/npm.

amorey commented 6 years ago

@ivanwolf15 Thanks again for the pull request. Your enhancement is included in the latest version (0.9.29): https://www.muicss.com https://www.npmjs.com/package/muicss