adopted-ember-addons / adopted-ember-addons/emberx-select

selectionChanged loop in 2.2.2

Ouverte
#151 6 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Investigate
Langage dominant
JavaScript
Étoiles
198
Forks
77
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

### Version of x-select: 2.2.2
### Ember Version / Ember CLI Version:

**Ember Version:** 2.6
**Ember CLI Version:** 2.6
### Expected Behavior

Initializing an `x-select` should not immediately trigger the changed `action`
### Actual Behavior

Initializing an `x-select` immediately triggers the changed `action`
### Info

We initialize an `x-select` component with the `value` set to a models attribute, `foo.bar`. Our `action` bubbles up and eventually triggers a `save` on the model, which worked absolutely fine until version `2.2.2` of this addon.

In `2.2.2` the `change` event is immediately triggered, which causes an infinite loop where the event causes a save, which then causes the property to change and the change event to fire again for some reason. We hide the select box while the model is saving (I think this is a fairly common pattern), which destroys the component. When the model finishes saving the component is re-created, which then again triggers the save event.

It is caused by this commit: ea9522537cd4a4eb0b6c46f283bb13f0f1989860

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.