Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

Commit

Permalink
Fix: Stop propagation of click on tooltip when active (#1229)
Browse files Browse the repository at this point in the history
  • Loading branch information
nayakrahul committed Apr 17, 2020
1 parent 6e5f06c commit 23c8d6d
Showing 1 changed file with 29 additions and 21 deletions.
50 changes: 29 additions & 21 deletions src/components/row.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ function Row(props) {
props.handleReveal(props.state.state);
};

const handleTooltip = (e) => {
e.stopPropagation();
};

const sortDistricts = useCallback(
(aDistricts) => {
const sorted = {};
Expand Down Expand Up @@ -111,27 +115,31 @@ function Row(props) {
<span className="actual__title-wrapper">
{state.state}
{state.statenotes && (
<Tooltip
content={[`${state.statenotes}`]}
styles={{
tooltip: {
background: '#000',
borderRadius: '5px',
fontSize: '1rem',
left: '250%',
opacity: 1,
padding: '0.5rem',
},
wrapper: {
cursor: 'cursor',
display: 'inline-block',
position: 'relative',
textAlign: 'center',
},
}}
>
<Icon.Info />
</Tooltip>
<span onClick={handleTooltip}>
<Tooltip
content={[`${state.statenotes}`]}
styles={{
tooltip: {
background: '#000',
borderRadius: '10px',
fontSize: '.8em',
left: '250%',
opacity: 0.65,
},
wrapper: {
cursor: 'cursor',
display: 'inline-block',
position: 'relative',
textAlign: 'center',
},
arrow: {
left: '37%',
},
}}
>
<Icon.Info />
</Tooltip>
</span>
)}
</span>
</div>
Expand Down

1 comment on commit 23c8d6d

@vercel
Copy link

@vercel vercel bot commented on 23c8d6d Apr 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.