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

[Bug]: Native Checkbox validation errors are misaligned #10002

Open
2 tasks done
brunnerh opened this issue Oct 31, 2021 · 3 comments · Fixed by #10142
Open
2 tasks done

[Bug]: Native Checkbox validation errors are misaligned #10002

brunnerh opened this issue Oct 31, 2021 · 3 comments · Fixed by #10142
Assignees

Comments

@brunnerh
Copy link

Package

carbon-components-react

Browser

Chrome, Firefox, Edge

Package version

v7.47.0

Description

When adding native validation errors to the checkbox, the generated notification will be misaligned because the real checkbox element is not where the visual checkbox is.

Before submit:

image

After submit:

Chrome/Edge
image

Firefox
image


Related issue for custom validation errors: #5390

Even if this is implemented, it would be nice if native validation were still supported.

CodeSandbox example

https://codesandbox.io/s/carbon-checkbox-validity-mw4vo

Steps to reproduce

  • Add Checkbox component
  • Use setCustomValidity and reportValidity on underlying input element

Code of Conduct

@brunnerh
Copy link
Author

brunnerh commented Jan 22, 2022

I just did some testing and apparently Safari (which I had no access to at the time) aligns the message at the top. So for this to work properly in all major browsers, the underlying <input> should probably fill the same bounding box as the visible checkbox.

image

This can also happen in other browsers, e.g. Chrome, if there is not enough space below the input.

@brunnerh
Copy link
Author

@jnm2377 Could this be re-opened to address alignment of validation messages that appear above the input? (See previous comment)

@tw15egan
Copy link
Collaborator

Based on #15435 (comment), we still need to fix this issue with Checkbox. @riddhybansal, do you want to tackle that one as well?

@tw15egan tw15egan reopened this Feb 21, 2024
@github-project-automation github-project-automation bot moved this from ✅ Done to ⏱ Backlog in Design System Feb 21, 2024
@tw15egan tw15egan assigned riddhybansal and unassigned jnm2377 Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants