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(forms): avoid .is-required element to be alone on a new line #2760

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

julien-deramond
Copy link
Member

@julien-deramond julien-deramond commented Oct 14, 2024

Related issues

Closes #2758

Description

This PR fixes the issue described at #2758 where the asterisk showing that a form control is required can be alone on a new line when the label length has exactly the same length as the corresponding input.

I tried different non-working solutions based on word-wrap and non breakable space without success. This PR relies on @jacques-lebourgeois's suggestion.

The only drawback I've found of this fix is that the asterisk, intead of going to the new line, stays on the same line but is displayed in the safe area; outside of the bounding box that we should use. However, I'd consider that as a minor issue.

See:

Screenshot 2024-10-14 at 08 08 06

Types of change

  • Bug fix (non-breaking which fixes an issue)

Live previews

Copy link

netlify bot commented Oct 14, 2024

Deploy Preview for boosted ready!

Name Link
🔨 Latest commit 612427e
🔍 Latest deploy log https://app.netlify.com/sites/boosted/deploys/670cd7f4df13a30008360803
😎 Deploy Preview https://deploy-preview-2760--boosted.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 configuration.

@julien-deramond julien-deramond marked this pull request as ready for review October 14, 2024 06:11
Copy link
Member

@louismaximepiton louismaximepiton left a comment

Choose a reason for hiding this comment

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

I tried few things as well, but I also think that it's the best option in here. Well done 🎉

@julien-deramond julien-deramond force-pushed the main-jd-fix-is-required-positioning branch from 18463ad to 612427e Compare October 14, 2024 08:36
@julien-deramond julien-deramond merged commit c13d6f0 into main Oct 14, 2024
11 of 12 checks passed
@julien-deramond julien-deramond deleted the main-jd-fix-is-required-positioning branch October 14, 2024 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

The asterisk positioned on a label of a required field returns to the line
2 participants