Skip to content

Commit

Permalink
fix alignment with span
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthkp committed May 10, 2022
1 parent 393c440 commit 3bd3382
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Tooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ export const Tooltip: React.FC<TooltipProps> = ({
<Box
as="span"
sx={{
':hover, :focus-within': {'[data-component=tooltip]': {visibility: 'visible', opacity: 1}}
':hover, :focus-within': {'[data-component=tooltip]': {visibility: 'visible', opacity: 1}},
lineHeight: 1 // we don't want the span wrapper to cause misalignment
}}
>
<TooltipContext.Provider value={{tooltipId}}>{child}</TooltipContext.Provider>
Expand Down
8 changes: 8 additions & 0 deletions src/__tests__/__snapshots__/TextInput.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,10 @@ exports[`TextInput renders trailingAction icon button 1`] = `
margin: 4px;
}
.c3 {
line-height: 1;
}
.c3:hover [data-component=tooltip],
.c3:focus-within [data-component=tooltip] {
visibility: visible;
Expand Down Expand Up @@ -1846,6 +1850,10 @@ exports[`TextInput renders trailingAction text button with a tooltip 1`] = `
margin: 4px;
}
.c3 {
line-height: 1;
}
.c3:hover [data-component=tooltip],
.c3:focus-within [data-component=tooltip] {
visibility: visible;
Expand Down
4 changes: 4 additions & 0 deletions src/__tests__/__snapshots__/Tooltip.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Tooltip renders consistently 1`] = `
.c0 {
line-height: 1;
}
.c0:hover [data-component=tooltip],
.c0:focus-within [data-component=tooltip] {
visibility: visible;
Expand Down
1 change: 1 addition & 0 deletions src/stories/ActionMenu/fixtures.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ export function MemexTableMenu(): JSX.Element {
width: 200,
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
p: 2,
border: '1px solid',
borderColor: 'border.default'
Expand Down

0 comments on commit 3bd3382

Please sign in to comment.