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: Form Labels to not extend full width of field #1022

Merged
merged 3 commits into from
May 14, 2024
Merged

fix: Form Labels to not extend full width of field #1022

merged 3 commits into from
May 14, 2024

Conversation

bdow
Copy link
Contributor

@bdow bdow commented May 13, 2024

Kind of an annoying issue that I've see is you try to click away from a SelectField to close the menu, but instead the menu flickers and opens back up. This was due to clicking above the field, which happened to be still clicking on the label element which was taking up the full width of its container. When clicking a label element, then the focus is set to the associated field. By adding 'align-self: flex-start', then the label element no longer extends the full width of the container.

See Loom for example:
https://www.loom.com/share/7b2dd9d22c1a457f991aca884a45731b

Kind of an annoying issue that I've see is you try to click away from a SelectField to close the menu, but instead the menu flickers and opens back up. This was due to clicking above the field, which happened to be still clicking on the label element which was taking up the full width of its container. When clicking a label element, then the focus is set to the associated field. By adding 'align-self: flex-start', then the label element no longer extends the full width of the container.
Copy link
Contributor

@stephenh stephenh left a comment

Choose a reason for hiding this comment

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

Wow, great attention to detail!

I'm surprised setting the align-self makes it not stretch 🤷

@bdow bdow merged commit 0c636b7 into main May 14, 2024
6 checks passed
@bdow bdow deleted the label-fix branch May 14, 2024 01:08
homebound-team-bot pushed a commit that referenced this pull request May 14, 2024
## [2.344.1](v2.344.0...v2.344.1) (2024-05-14)

### Bug Fixes

* Form Labels to not extend full width of field ([#1022](#1022)) ([0c636b7](0c636b7))
@homebound-team-bot
Copy link

🎉 This PR is included in version 2.344.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants