-
Notifications
You must be signed in to change notification settings - Fork 357
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
Consume core Penta updates: Form controls, checkbox, radio #10016
Changes from all commits
e4da81b
9faa8ea
5a8470b
4c5f0b2
a417946
8963d67
41b1c0c
6225579
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react'; | ||
import { Button, ButtonProps } from '../Button'; | ||
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon'; | ||
|
||
/** A help button to be passed to the FormGroup's labelHelp property. This should be wrapped or linked | ||
* to our Popover component. | ||
*/ | ||
export interface FormGroupLabelHelpProps extends ButtonProps { | ||
/** Adds an accessible name for the help button. */ | ||
'aria-label': string; | ||
/** Additional classes added to the help button. */ | ||
className?: string; | ||
} | ||
|
||
export const FormGroupLabelHelp: React.FunctionComponent<FormGroupLabelHelpProps> = ({ | ||
'aria-label': ariaLabel, | ||
className, | ||
...props | ||
}) => ( | ||
<Button aria-label={ariaLabel} className={className} variant="plain" hasNoPadding {...props}> | ||
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. I'll just mention that in core we use the The reason for ^ is that some users want the help icon to wrap with the label text - or more specifically, they don't want the help icon to wrap on its own line (orphan), so it needs to wrap with at least one word of the label text. We can't get the label text to wrap with a I might suggest using the 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. @mcoker Good point Michael! I remember I actually was applying So I was wondering why it is not there now. I was just about to commit your suggestion and then I realized why I did not apply the span: button: Seems like this issue is related to the implementation of the Popover, so I am taking a look at that now. For now I would keep it as 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. @adamviktora nice, thanks for digging in and for the explanation! Sounds like a plan 👍👍 |
||
<QuestionCircleIcon /> | ||
</Button> | ||
); | ||
FormGroupLabelHelp.displayName = 'FormGroupLabelHelp'; |
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.
This is exported, do we have codemod issue for this?
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.
Thanks for the catch! now we do: patternfly/pf-codemods#609