Skip to content

Commit

Permalink
[beta] 2.0.0-rc3: [fix] Use 'startsWith' instead of 'includes' for ev…
Browse files Browse the repository at this point in the history
…ent listener (#75)

* [fix] Recognize cluster event listener with 'startsWith' instead of 'includes'

* [build] Source
  • Loading branch information
yuzhva authored Jul 10, 2018
1 parent 7975d49 commit 563e543
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/react-leaflet-markercluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var MarkerClusterGroup = function (_MapLayer) {
propName = _ref3[0],
prop = _ref3[1];

return propName.includes('on') ? clusterEvents[propName] = prop : clusterProps[propName] = prop;
return propName.startsWith('on') ? clusterEvents[propName] = prop : clusterProps[propName] = prop;
});

// Creating markerClusterGroup Leaflet element
Expand Down
2 changes: 1 addition & 1 deletion dist/react-leaflet-markercluster.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-leaflet-markercluster",
"version": "2.0.0-rc2",
"version": "2.0.0-rc3",
"description": "React wrapper of Leaflet.markercluster for react-laeflet",
"main": "dist/react-leaflet-markercluster.min.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/react-leaflet-markercluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class MarkerClusterGroup extends MapLayer {

// Splitting props and events to different objects
Object.entries(props).forEach(
([propName, prop]) => propName.includes('on')
([propName, prop]) => propName.startsWith('on')
? clusterEvents[propName] = prop
: clusterProps[propName] = prop
);
Expand Down

0 comments on commit 563e543

Please sign in to comment.