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

Suggestion: change names of event #16

Open
christophe-g opened this issue Aug 14, 2016 · 1 comment · May be fixed by #27
Open

Suggestion: change names of event #16

christophe-g opened this issue Aug 14, 2016 · 1 comment · May be fixed by #27

Comments

@christophe-g
Copy link
Contributor

Because Polymer event (set in sortablejs.html) have the same name as in the native Sortable library,
a Polymer listener function would be called twice. What I usually do is to process the function only when event.detail exists :

listeners : {
  'sortable.add': 'onSortableAdd'
},

onSortableAdd: function(e) {
console.info('called twice');
if(e.detail) {
   doStuff
}

What about changing all event with a sortable- prefix (before too many people use this young library...)

Thanks anyway,
C.

@L-u-k-e
Copy link

L-u-k-e commented Sep 5, 2016

Either that, stop the propagation of the original event, or don't fire the custom one please.

The double event behavior confused me until I looked at the source.

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