rungwiroon / BlazorGoogleMaps

Blazor interop for GoogleMap library
MIT License
309 stars 99 forks source link

Fix bug: OnClick events from elements in custom controls not working after v3.3.1 #302

Closed cruiserkernan closed 7 months ago

cruiserkernan commented 7 months ago

Description

This pull request fixes a bug introduced in v3.3.1, issue #298, where OnClick events from elements in custom controls stopped working. It also disposes used resources.

Implemented Changes

objectManager.js:

  1. Removal of elem.clone() in addControls:
  1. Enhanced Handling of controlParents:
  1. Refactoring for Better Management:

New and Updated Examples

New: MapsLegendPage

Demonstrates custom controls in multi-map scenarios, highlighting independent control management across different maps.

Updated: MapLegendPage

Showcases enhanced add/remove control features with event handling, focusing on Blazor component interactions.

Thank you for considering this pull request!

valentasm1 commented 7 months ago

If you come to MapLegends, do nothing and go to other pages. In such case it get null reference error. Fixed with this commit. https://github.com/rungwiroon/BlazorGoogleMaps/commit/b2d33c86c2db7d4d9b88d780c2df5e768d2f6dc5