| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
PatternFly-React preview: https://patternfly-react-pr-3053.surge.sh |
Sorry, something went wrong.
Codecov Report
@@ Coverage Diff @@
## master #3053 +/- ##
==========================================
- Coverage 69.02% 69.02% -0.01%
==========================================
Files 858 858
Lines 23413 23416 +3
Branches 1853 1854 +1
==========================================
+ Hits 16160 16162 +2
- Misses 6333 6334 +1
Partials 920 920
Continue to review full report at Codecov.
|
Sorry, something went wrong.
|
Very close to CI passing: Snapshot Summary › 2 snapshots failed from 1 test suite. Inspect your code changes or run `yarn run test:pf4 -u` to update them. Test Suites: 1 failed, 157 passed, 158 total Tests: 2 failed, 849 passed, 851 total Snapshots: 2 failed, 621 passed, 623 total |
Sorry, something went wrong.
| /** Tooltip trigger: click, mouseenter, focus, manual */ | ||
| trigger?: string; | ||
| /** Flag to indicate that the text content is left aligned */ | ||
| isContentLeftAligned?: boolean; |
There was a problem hiding this comment.
Why only support a left aligned option? What if designers want to support right-aligned content, next?
Even if we don't support right-aligned content for now, something more like this would scale better in the future.
contentPosition?: 'bottom' | 'center' | 'right';
Then we could create an enum
export enum TooltipContentPosition {
bottom = 'bottom',
center = 'center',
right = 'right'
}
Looks like we already take this approach for the position property.
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
I wasn't necessarily asking for right-aligned tooltips, just that we use a property that is more scalable. Once we introduce the isContentLeftAligned prop, it will be difficult to change without a breaking change. That's why I suggested we use something more like the existing position property.
I just want to consider a use case where we end up with both isContentLeftAligned and isContentRightAligned props together? Or, would it be better to have something more like contentPosition?: 'bottom' | 'center' | 'right' where we can easily add future support.
Sorry, something went wrong.
There was a problem hiding this comment.
Dan makes good point here. I don't think there are plans of introducing the right aligned variant and the naming here seems to be consistent with other components. That being said those components would be hard to change if we added another variant.
Sorry, something went wrong.
There was a problem hiding this comment.
@tlabaj Thank you for your feedback! Does that mean I should change the prop to look like contentPosition?: 'left' | 'center'? Or did you mean that this PR is okay the way it is?
Sorry, something went wrong.
There was a problem hiding this comment.
If you don't feel we'll ever have another variant, I'm fine leaving it as is. Just wanted to raise the question.
Sorry, something went wrong.
There was a problem hiding this comment.
@jenny-s51 I think we should use contentPosition?: 'left' | 'center'. It's also consistent with the position enum we are already using in this component. Can we change it to that?
Sorry, something went wrong.
There was a problem hiding this comment.
@jenny-s51 I like what @dlabrecq suggested. But, if we are not going to have a right alignment variation I don't see the need to introduce the inconstancy. We have at least one other component that uses isLeftAligned (or similar).
@mcarrano can you verify that there is no intent on introducing a right aligned variant.
Sorry, something went wrong.
There was a problem hiding this comment.
I see no reason to support right-aligned tooltips.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM, unused import doesn't affect anything.
Sorry, something went wrong.
| cssPrefix: 'pf-c-tooltip' | ||
| typescript: true | ||
| propComponents: ['Tooltip'] | ||
| propComponents: ['Tooltip', 'TooltipContent'] |
There was a problem hiding this comment.
Good catch, we export TooltipContent in Tooltip/index.ts but don't show its props in the docs.
Edit: We should add a followup issue to provide examples on how/why to use TooltipContent.
Sorry, something went wrong.
There was a problem hiding this comment.
All set! #3088
Sorry, something went wrong.
| --- | ||
|
|
||
| import { Button, Tooltip, TooltipPosition, Checkbox } from '@patternfly/react-core'; | ||
| import { Button, Tooltip, TooltipPosition, TooltipContent, Checkbox } from '@patternfly/react-core'; |
There was a problem hiding this comment.
Unused import.
Sorry, something went wrong.
There was a problem hiding this comment.
lgtm, thanks @jenny-s51!!
Sorry, something went wrong.
There was a problem hiding this comment.
Can you update this to use contentPosition?: 'left' | 'center'`
Sorry, something went wrong.
| /** Tooltip trigger: click, mouseenter, focus, manual */ | ||
| trigger?: string; | ||
| /** Flag to indicate that the text content is left aligned */ | ||
| isContentLeftAligned?: boolean; |
There was a problem hiding this comment.
@jenny-s51 I think we should use contentPosition?: 'left' | 'center'. It's also consistent with the position enum we are already using in this component. Can we change it to that?
Sorry, something went wrong.
There was a problem hiding this comment.
After looking at what we do elsewhere it seems we should go with IsContentLeftAligned. We only seem to use the enum when there are more than one style, and we are using IsLeftAligned elsewhere through out the product.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
will close #3013