Shopify / polaris

Shopify’s design system to help us work together to build a great experience for all of our merchants.
https://polaris.shopify.com
Other
5.78k stars 1.17k forks source link

Enforce non-empty labels & titles #2194

Closed sambostock closed 2 years ago

sambostock commented 5 years ago

Feature request summary

Empty label props (e.g. <TextField label="" />) should be prevented, in favour of a non-empty label combined with labelHidden.

This should also be the case for similar props (e.g. <ChoiceList title="" />). Any required string x prop, with a xHidden companion prop should disallow empty strings.

This might addressable be via types, linting, throwing an error, or some combination thereof.

Rationale

Accessibility isn’t an after thought, so we should enforce it. @AndrewMusgrave


🌟 Feature requests that are not yet planned will be closed. We then use the issue’s :+1: upvotes to track and set priorities. See the contribution guidelines for more information.

sambostock commented 5 years ago

Based on git grep '\b[a-z]\+Hidden?', it looks like the affected components are:

dpersing commented 5 years ago

Thank you so much, @sambostock! We'll look into updating our documentation and tests.

yurm04 commented 2 years ago

Thanks for the request, @sambostock . We’re not actively working on this right now, but we keep an eye on all feature requests.

I’ll close this issue for now, but we encourage everyone who wants this feature to add a 👍 to the original issue report. We’ll take your collective interest into account when we look at what to work on next. 💜