Skip to content

Commit 3a18b25

Browse files
authored
fixed issue with hover tooltips not showing touch screen laptops (#2422)
1 parent ee7e6c2 commit 3a18b25

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

packages/map/src/CdcMapComponent.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -561,16 +561,14 @@ const CdcMapComponent: React.FC<CdcMapComponent> = ({
561561
{accessibleStatus}
562562
</div>
563563

564-
{!isDraggingAnnotation &&
565-
!window.matchMedia('(any-hover: none)').matches &&
566-
'hover' === tooltips.appearanceType && (
567-
<ReactTooltip
568-
id={`tooltip__${tooltipId}`}
569-
float={true}
570-
className={`tooltip tooltip-test`}
571-
style={{ background: `rgba(255,255,255, ${config.tooltips.opacity / 100})`, color: 'black' }}
572-
/>
573-
)}
564+
{!isDraggingAnnotation && 'hover' === tooltips.appearanceType && (
565+
<ReactTooltip
566+
id={`tooltip__${tooltipId}`}
567+
float={true}
568+
className={`tooltip tooltip-test`}
569+
style={{ background: `rgba(255,255,255, ${config.tooltips.opacity / 100})`, color: 'black' }}
570+
/>
571+
)}
574572
<div
575573
ref={tooltipRef}
576574
id={`tooltip__${tooltipId}-canvas`}

packages/map/src/hooks/useGeoClickHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const useGeoClickHandler = () => {
3131
}
3232

3333
// If modals are set, or we are on a mobile viewport, display modal
34-
if (window.matchMedia('(any-hover: none)').matches || 'click' === state.tooltips.appearanceType) {
34+
if ('click' === state.tooltips.appearanceType) {
3535
const modalData = {
3636
geoName: geoDisplayName,
3737
keyedData: geoData

0 commit comments

Comments
 (0)