amsul / amsul/pickadate.js

Muted option doesn't apply to change event

Aperta
#502 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
7.6k
Fork
981
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

When using the picker in a form which is monitored by a change listener, trouble arises.

Imagine:

``` JavaScript
$('form').change(function(){

if ( condition_is_met ) {

// This would fire the change event again, causing an infinite loop.
picker.clear();

// Only prevents the 'set' event, and thus doesn't resolve the issue.
picker.clear({ muted: true });
}
});
```

Perhaps the `muted` option should prevent the `change` event from being fired. I'd make a pull request, but I'd expect current implementations to rely on the change event _always_ being fired on a `set` call.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.