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

Consistently adjust the padding for all form selects #21673

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

garrett
Copy link
Member

@garrett garrett commented Mar 5, 2025

It seems Firefox fixed their longstanding bug, which caused the workaround in PatternFly (who adopted it from us) to no longer be relevant. I adjusted our own workaround, but it didn't apply as PatternFly also (at some point in time) changed the DOM so the selector no longer matched.

We'll want to communicate this with PF to get PF6 fixed. Possibly even PF5 too, as it apparently changed in Firefox recently, and therefore newer versions of Firefox will "break" the expected layout without addressing it in PF directly (or with a workaround in codebases).

Fixes #21671

@garrett garrett requested a review from Venefilyn March 5, 2025 17:00
@garrett
Copy link
Member Author

garrett commented Mar 5, 2025

Zoomed screenshot crop with a guide to show how form selects are now consistent with selects and other inputs:

image

(The 1 in 100 is deceptive, as it starts at the serif, not the stem, BTW.)

@garrett
Copy link
Member Author

garrett commented Mar 5, 2025

I wonder if we can drop the right-side hardcoding and only keep the left padding. And if we should rescope to only apply to Firefox (to work around the upstream workaround until it's adjusted in PatternFly directly). And then update the comments, probably.

It's something to look into tomorrow, and to report to PatternFly upstream.

@garrett
Copy link
Member Author

garrett commented Mar 6, 2025

Oh, perhaps we still need the padding on the right for Firefox... for example:

image

As seen in https://issues.redhat.com/browse/RHEL-12150

@garrett
Copy link
Member Author

garrett commented Mar 11, 2025

Re-adding the right padding, this time the cross-browser version (41px), gives me:

Screenshot From 2025-03-11 09-32-56

Instead of:

Screenshot From 2025-03-11 09-33-08

So then I went back to check on other browsers, and here's Chrome without any overrides:

image

(I checked this by changing the grid to flex in .pf-v5-c-form__group.)

So we need to re-add the spacing for all browsers to some degree.

@garrett garrett force-pushed the pf-override-form-select-fixup branch from a04f7ae to 3f1eb7a Compare March 11, 2025 13:03
It seems Firefox fixed their longstanding bug, which caused the
workaround in PatternFly (who adopted it from us) to no longer be
relevant. I adjusted our own workaround, but it didn't apply as
PatternFly also (at some point in time) changed the DOM so the selector
no longer matched.

We'll want to communicate this with PF to get PF6 fixed. Possibly even
PF5 too, as it apparently changed in Firefox recently, and therefore
newer versions of Firefox will "break" the expected layout without
addressing it in PF directly (or with a workaround in codebases).

Meanwhile, overriding the override by setting the left spacing to be the
standard left spacing makes sense too. And we can just set this for
Firefox-only instead of everything (which would still work, of course,
but let's scope this to the scope of the issue related to the
workaround).
@garrett garrett force-pushed the pf-override-form-select-fixup branch from 3f1eb7a to 939284b Compare March 11, 2025 13:09
Copy link
Member

@Venefilyn Venefilyn left a comment

Choose a reason for hiding this comment

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

Works fine!

Comment on lines +63 to +66
--pf-v5-c-form-control--PaddingRight: calc(
var(--pf-v5-global--icon--FontSize--md) +
var(--pf-v5-global--spacer--lg)
);
Copy link
Member

Choose a reason for hiding this comment

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

Do we have to use lg spacer? md should be fine from what I can see

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.

regression: PatternFly selects are inconsistent again
2 participants