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(InputGroupText): drop variants and fix missing padding because of wrong classes #8953

Closed
wants to merge 1 commit into from

Conversation

KKoukiou
Copy link
Collaborator

Follow the html docs on how input-group text component should look like. https://pf5.patternfly.org/components/input-group/#overview

InputGroupText is meant to contain plain text. Any kind of variant setting is overkill, we should just provide users with a straightforward way to put a plain text inside an input group and have all the needed padding sets.

Fixes #8952

@patternfly-build
Copy link
Contributor

patternfly-build commented Apr 13, 2023

… wrong classes

Follow the html docs on how input-group text component should look like.
https://pf5.patternfly.org/components/input-group/#overview

InputGroupText is meant to contain plain text. Any kind of variant
setting is overkill, we should just provide users with a straightforward way to put a plain text
inside an input group and have all the needed padding sets.

Fixes patternfly#8952
@KKoukiou
Copy link
Collaborator Author

Screenshot of an application of this component on the slider documentation:

Before:
Screenshot from 2023-04-13 17-43-24

After:
Screenshot from 2023-04-13 17-42-45

Comment on lines -5 to -8
export enum InputGroupTextVariant {
default = 'default',
plain = 'plain'
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we would want to remove this enum and the variant prop. Part of what the plain variant should be doing is removing that bottom border from pf-c-input-group__item. My comment below mentions it as well, but it looks like the cause of the padding issue might be the markup not matching Core. @srambach wdyt (including my other comment below)?

Copy link
Member

Choose a reason for hiding this comment

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

I think we want to keep the option to make it plain or not, and I agree that the problem seems to be that the markup is slightly different as @thatblindgeye comments below.

Comment on lines +24 to +27
styles.inputGroupItem,
styles.inputGroupText,
variant === InputGroupTextVariant.plain && styles.modifiers.plain,
styles.modifiers.plain,
styles.modifiers.box,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is causing differences in the markup compared to Core. In Core the markup is:

Core markup for InputGroup

This PR the markup becomes:

PR preview markup for InputGroup

@KKoukiou
Copy link
Collaborator Author

So @thatblindgeye @srambach do we want to have the exact same structure in html like in core? I find this wrapping with <div> <span> rather superfluous.

@srambach
Copy link
Member

srambach commented May 1, 2023

@KKoukiou Good question. In this case it would be simpler, but I would say that keeping them separate means that if there are multiple __text elements for some reason, then they don't get the extra spacing that the __item is providing. 🤷‍♀️

@tlabaj
Copy link
Contributor

tlabaj commented May 5, 2023

@KKoukiou typically we match the structure core has. If we need to update the structure core should do so as well.

@tlabaj
Copy link
Contributor

tlabaj commented May 18, 2023

HI Katerina. Maria contributed this PR #9074.
I will be following up with another PR to remove the variant from InputGroupText that is no longer needed (issue #9146) . I believe this should resolve the issue you are seeing so I will close this PR. If there is still an issue with our implementation please feel free to open another issue or reach out to use directly to discuss. Thanks

@tlabaj tlabaj closed this May 18, 2023
@KKoukiou KKoukiou deleted the input-group-text branch May 19, 2023 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug - [InputGroupText] - [Input group text is missing default padding]
6 participants