discourse/app/assets/javascripts/wizard/components/radio-button.js.es6
Robin Ward fcb1ca52f9 Revert Ember.run refactors
This reverts commit 5ca60fcb6b.
2019-10-29 17:10:47 -04:00

21 lines
466 B
JavaScript

import Component from "@ember/component";
import { observes, on } from "ember-addons/ember-computed-decorators";
export default Component.extend({
tagName: "label",
click(e) {
e.preventDefault();
this.onChange(this.radioValue);
},
@observes("value")
@on("init")
updateVal() {
const checked = this.value === this.radioValue;
Ember.run.next(
() => (this.element.querySelector("input[type=radio]").checked = checked)
);
}
});