Skip to content
This repository was archived by the owner on Feb 19, 2024. It is now read-only.

Commit 798cca4

Browse files
authored
Merge pull request #503 from onaio/bug-pop-not-showing
Resolve map popup not showing when source data numerical value is of type string
2 parents b8b224e + f1e5c98 commit 798cca4

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/map/addPopUp.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,16 @@ export default function addMousemoveEvent(mapId, mapboxGLMap, dispatch) {
114114
// if row matches property
115115
if (
116116
(layer.popup.join &&
117-
row[layer.popup.join[0]] ===
117+
/* Use double equals to ensure matches when source data numbers are formatted as strings e.g
118+
123" instead of 123 */
119+
// eslint-disable-next-line eqeqeq
120+
row[layer.popup.join[0]] ==
118121
(feature.properties && feature.properties[layer.popup.join[1]])) ||
119122
(!layer.popup.join &&
120-
row[layer.source.join[1]] ===
123+
/* Use double equals to ensure matches when source data numbers are formatted as strings e.g
124+
123" instead of 123 */
125+
// eslint-disable-next-line eqeqeq
126+
row[layer.source.join[1]] ==
121127
(feature.properties && feature.properties[layer.source.join[0]]))
122128
) {
123129
// Add header and body to popup with data from layer

0 commit comments

Comments
 (0)