Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/no label input dropdown #1619

Merged
merged 11 commits into from
Mar 21, 2023
Merged

Fix/no label input dropdown #1619

merged 11 commits into from
Mar 21, 2023

Conversation

felix-ico
Copy link
Collaborator

@felix-ico felix-ico commented Feb 23, 2023

this would fix #827 ...not sure if it's a good idea to allow inputs without labels though

@netlify
Copy link

netlify bot commented Feb 23, 2023

Deploy Preview for marvelous-moxie-a6e2fe ready!

Name Link
🔨 Latest commit d4a2551
🔍 Latest deploy log https://app.netlify.com/sites/marvelous-moxie-a6e2fe/deploys/64199822bf72f6000829f204
😎 Deploy Preview https://deploy-preview-1619--marvelous-moxie-a6e2fe.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Collaborator

@acstll acstll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the label is definitely a bad idea as you suggest, for accessibility reasons. But I think we can provide allowing to hide the label, as requested, if we follow the recommendations here https://www.w3.org/WAI/tutorials/forms/labels/#hiding-label-text
So we try and make sure there is always a label, either visible or not.

I can think of two options, but probably there are many more:

  • We make the label required, and add a hideLabelVisually prop to make it visually hidden, and adjust the layout for the input text to be vertically aligned as in this PR ("approach 1" in the article)
  • We add an innerAriaLabel prop, and adjust the layout when no label is present ("approach 2" in the article)

@felix-ico what do you think?

@felix-ico
Copy link
Collaborator Author

felix-ico commented Feb 24, 2023

@acstll I'd go for approach # 1, I'll make the necessary changes! 🙌

Copy link
Collaborator

@acstll acstll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! — I think we should also add the new hideLabelVisually prop to Storybook. Thank you!

@@ -241,16 +242,15 @@ export class TextField {
'datetime-local',
];

console.log('HIDE LABEL ? ', this.hideLabelVisually, this.label);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🫣

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?? I'm not sure what happened here but this was removed a while ago 129a2b6

@felix-ico felix-ico merged commit bd60e57 into main Mar 21, 2023
@felix-ico felix-ico deleted the fix/no-label-input-dropdown branch March 21, 2023 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: scale-text-field and scale-dropdown without a label
2 participants