Skip to content

Commit 3bd3382

Browse files
committed
fix alignment with span
1 parent 393c440 commit 3bd3382

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

src/Tooltip/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ export const Tooltip: React.FC<TooltipProps> = ({
7979
<Box
8080
as="span"
8181
sx={{
82-
':hover, :focus-within': {'[data-component=tooltip]': {visibility: 'visible', opacity: 1}}
82+
':hover, :focus-within': {'[data-component=tooltip]': {visibility: 'visible', opacity: 1}},
83+
lineHeight: 1 // we don't want the span wrapper to cause misalignment
8384
}}
8485
>
8586
<TooltipContext.Provider value={{tooltipId}}>{child}</TooltipContext.Provider>

src/__tests__/__snapshots__/TextInput.test.tsx.snap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,6 +1250,10 @@ exports[`TextInput renders trailingAction icon button 1`] = `
12501250
margin: 4px;
12511251
}
12521252
1253+
.c3 {
1254+
line-height: 1;
1255+
}
1256+
12531257
.c3:hover [data-component=tooltip],
12541258
.c3:focus-within [data-component=tooltip] {
12551259
visibility: visible;
@@ -1846,6 +1850,10 @@ exports[`TextInput renders trailingAction text button with a tooltip 1`] = `
18461850
margin: 4px;
18471851
}
18481852
1853+
.c3 {
1854+
line-height: 1;
1855+
}
1856+
18491857
.c3:hover [data-component=tooltip],
18501858
.c3:focus-within [data-component=tooltip] {
18511859
visibility: visible;

src/__tests__/__snapshots__/Tooltip.test.tsx.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`Tooltip renders consistently 1`] = `
4+
.c0 {
5+
line-height: 1;
6+
}
7+
48
.c0:hover [data-component=tooltip],
59
.c0:focus-within [data-component=tooltip] {
610
visibility: visible;

src/stories/ActionMenu/fixtures.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ export function MemexTableMenu(): JSX.Element {
269269
width: 200,
270270
display: 'flex',
271271
justifyContent: 'space-between',
272+
alignItems: 'center',
272273
p: 2,
273274
border: '1px solid',
274275
borderColor: 'border.default'

0 commit comments

Comments
 (0)