-
Notifications
You must be signed in to change notification settings - Fork 353
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
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,35 +2,29 @@ import * as React from 'react'; | |
import styles from '@patternfly/react-styles/css/components/InputGroup/input-group'; | ||
import { css } from '@patternfly/react-styles'; | ||
|
||
export enum InputGroupTextVariant { | ||
default = 'default', | ||
plain = 'plain' | ||
} | ||
|
||
export interface InputGroupTextProps extends React.HTMLProps<HTMLSpanElement | HTMLLabelElement> { | ||
/** Additional classes added to the input group text. */ | ||
className?: string; | ||
/** Content rendered inside the input group text. */ | ||
children: React.ReactNode; | ||
/** Component that wraps the input group text. */ | ||
component?: React.ReactNode; | ||
/** Input group text variant */ | ||
variant?: InputGroupTextVariant | 'default' | 'plain'; | ||
} | ||
|
||
export const InputGroupText: React.FunctionComponent<InputGroupTextProps> = ({ | ||
className = '', | ||
component = 'span', | ||
children, | ||
variant = InputGroupTextVariant.default, | ||
...props | ||
}: InputGroupTextProps) => { | ||
const Component = component as any; | ||
return ( | ||
<Component | ||
className={css( | ||
styles.inputGroupItem, | ||
styles.inputGroupText, | ||
variant === InputGroupTextVariant.plain && styles.modifiers.plain, | ||
styles.modifiers.plain, | ||
styles.modifiers.box, | ||
Comment on lines
+24
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
className | ||
)} | ||
{...props} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 theplain
variant should be doing is removing that bottom border frompf-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)?There was a problem hiding this comment.
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.