Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

combining ember-leaflet with ember-paper leads to events not propagated #121

Closed
saerdnaer opened this issue Jul 15, 2015 · 6 comments
Closed

Comments

@saerdnaer
Copy link

In my current project I'd like to use a paper-slider inside of a leaflet popup. You can find my current state at http://saerdnaer.github.io/ember-paper-leaflet-example/
The problem is that the slider inside the popup is not usable, as it's not possible to move the dot to the other end of the slider.

It looks like leaflet is catching the mouse/touch move event's and the slider doesn't get notified anymore. I already switched to the current master/beta of leaflet 1.0 where as simular issue was fixed (Leaflet/Leaflet#3307 ) but this didn't solve my issue.

I also tried to remove/comment the L.DomEvent.stopPropagation(e) like suggested at http://stackoverflow.com/a/28223886/521791 , but then I couldn't open the popup anymore.

Can anyone give me some pointers, how I can fix this issue?

@miguelcobain
Copy link
Collaborator

Cool customization of leaflet!

I can't open any popup in your example, right now, possibly because the change you made later. Can you change back to original state to check the issue?

@mjanda
Copy link
Contributor

mjanda commented Jul 15, 2015

I do something similar and my solution is to add custom handler in didCreateLayer that catches mousedown/dblclick, checks e.target and if it's my overlay, stops propagation.

@saerdnaer
Copy link
Author

@miguelcobain I just reverted (force pushed) the gh-pages branch of my example to the commit before. I did't expect that bugfix for mobile-safari would change something on this issue.
BTW: Moving the paper-switch by touch works for some reason, where ember-slider doesn't...

@saerdnaer
Copy link
Author

@mjanda: Might you post a source code snippet?

@mjanda
Copy link
Contributor

mjanda commented Jul 15, 2015

I have canvas chart over my map, so I can just compare tagName - your case might be more complicated.

didCreateLayer: function() {
    this._super();

    // add chart overlay in fullscreen
    new ChartOverlay({}).addTo(this._layer);
    $('.chart-overlay').on('mousedown.map-fullscreen dblclick.map-fullscreen', function(e) {
      // allow interaction with chart controls without affecting underlying map
      if (e.target.tagName.toLowerCase() === 'canvas') {
        e.stopPropagation();
      }
    });
  },

  willDestroyLayer: function() {
    this._super();

    $('.chart-overlay').off('mousedown.map-fullscreen dblclick.map-fullscreen');
  }

@saerdnaer
Copy link
Author

looks like this issue got resolved with leaflet 1.0.0-beta.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants