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: use units in select label padding calculation #5848

Merged
merged 2 commits into from
Jun 14, 2024

Conversation

nfejzic
Copy link

@nfejzic nfejzic commented Jun 6, 2024

Addition in css' calc function requires both operands to be <length>. Using invalid value (<number> in this case) causes the calculation to fail and padding is not applied at all:

image

Using valid value (1rem) fixes the issue and padding is inserted as expected:

image

Fixes

This PR fixes #5847.

Copy link

vercel bot commented Jun 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
primevue ⬜️ Ignored (Inspect) Visit Preview Jun 13, 2024 2:23pm
primevue-v3 ⬜️ Ignored (Inspect) Visit Preview Jun 13, 2024 2:23pm
primevue-v4 ⬜️ Ignored (Inspect) Visit Preview Jun 13, 2024 2:23pm

@fabianszabo
Copy link

Here's more documentation: https://developer.mozilla.org/en-US/docs/Web/CSS/calc

For lengths, you can't use 0 to mean 0px (or another length unit); instead, you must use the version with the unit: margin-top: calc(0px + 20px); is valid, while margin-top: calc(0 + 20px); is invalid.

I know the documentation talks about the number zero specifically. However, I believe that it is clear that no number can be used in this way.

@mertsincan mertsincan linked an issue Jun 14, 2024 that may be closed by this pull request
@mertsincan mertsincan merged commit 46469fe into primefaces:v4 Jun 14, 2024
3 checks passed
@mertsincan
Copy link
Member

Good catch! Thanks a lot for your contribution!

@nfejzic nfejzic deleted the fix-select-clear-icon-padding branch June 14, 2024 09:04
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.

Select: Invalid padding calc when clear icon present
4 participants