diff --git a/assets/javascripts/discourse/components/wizard-custom-step.js.es6 b/assets/javascripts/discourse/components/wizard-custom-step.js.es6 index b48dadea..f0d9c48f 100644 --- a/assets/javascripts/discourse/components/wizard-custom-step.js.es6 +++ b/assets/javascripts/discourse/components/wizard-custom-step.js.es6 @@ -1,6 +1,18 @@ +import { observes } from 'ember-addons/ember-computed-decorators'; + export default Ember.Component.extend({ classNames: 'wizard-custom-step', currentField: null, currentAction: null, - disableId: Ember.computed.not('step.isNew') + disableId: Ember.computed.not('step.isNew'), + + @observes('step') + resetCurrentObjects() { + const fields = this.get('step.fields'); + const actions = this.get('step.actions'); + this.setProperties({ + currentField: fields.length ? fields[0] : null, + currentAction: actions.length ? actions[0] : null + }); + } }); diff --git a/assets/javascripts/discourse/templates/components/wizard-custom-field.hbs b/assets/javascripts/discourse/templates/components/wizard-custom-field.hbs index 07e6a826..a3079644 100644 --- a/assets/javascripts/discourse/templates/components/wizard-custom-field.hbs +++ b/assets/javascripts/discourse/templates/components/wizard-custom-field.hbs @@ -81,7 +81,7 @@