Skip to content

Commit

Permalink
feat(tooltip): Update bubble wrapper to a div tag
Browse files Browse the repository at this point in the history
  • Loading branch information
lzcabrera committed Oct 3, 2017
1 parent 30795bf commit 7c95a1f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/components/Tooltip/Tooltip.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ class Tooltip extends React.Component {
this.state.open ? styles.showBubble : styles.hideBubble
)

const ariaHidden = this.state.open ? 'false' : 'true'

return (
<span className={bubbleClasses} id={id} role='tooltip'>
<Box spacing="padding" vertical={3} horizontal={4}>
<div className={bubbleClasses} id={id} role='tooltip' aria-hidden={ariaHidden}>
<Box spacing="padding" vertical={2} horizontal={3}>
<Text size="small">{children}</Text>
</Box>
</span>
</div>
)
}

Expand Down
5 changes: 4 additions & 1 deletion src/components/Tooltip/Tooltip.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
```
<Tooltip id="the-id-1">This text describes the field.</Tooltip>
<div style={{display: 'flex'}}>
<div style={{flex: 1}}></div>
<Tooltip id="the-id-1">This text describes the field.</Tooltip>
</div>
```
2 changes: 1 addition & 1 deletion src/components/Tooltip/__tests__/Tooltip.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('Tooltip', () => {
<Tooltip {...overrides} id={id}>{children}</Tooltip>
)

const findBubbleElement = tooltip => tooltip.find('span')
const findBubbleElement = tooltip => tooltip.find('div').at(1)
const openBubble = tooltip => tooltip.find('button').simulate('click')

it('renders', () => {
Expand Down

0 comments on commit 7c95a1f

Please sign in to comment.