: you’re having issues with discourse-rating plugin on IE 11

Steps to Reproduce

issues : IE 11 : There is no value attribute.
ex)
New Topic rating view(IE 11) :
New Topic rating view(Chrome) :

directory : discourse-ratings\assets\javascripts\discourse\templates\components
source : {{rating-star value=star rating=rating enabled=enabled}}
value=star is Not applicable

solve :

  1. Go to discourse-ratings-master\discourse-ratings-master\assets\javascripts\discourse\components\rating-star.js.es6
  2. rating-star.js.es6 modify

import { default as computed } from ‘ember-addons/ember-computed-decorators’;
export default Ember.Component.extend({
tagName: “input”,
disabled: Ember.computed.not(‘enabled’),
attributeBindings: [“checked:checked”, “disabled:disabled”],

willInsertElement() {
this.$().prop(‘type’, ‘radio’);
this.$().prop(‘value’, this.$().val());
},

click() {
this.set(“rating”, this.$().val());
},

@computed(‘rating’)
checked(rating) {
return this.get(“value”) <= rating;
}
});

Example

Solve : import { default as computed } from ‘ember-addons/ember-computed-decorators’;

export default Ember.Component.extend({
tagName: “input”,
disabled: Ember.computed.not(‘enabled’),
attributeBindings: [“checked:checked”, “disabled:disabled”],

willInsertElement() {
this.$().prop(‘type’, ‘radio’);
this.$().prop(‘value’, this.$().val());
},

click() {
this.set(“rating”, this.$().val());
},

@computed(‘rating’)
checked(rating) {
return this.get(“value”) <= rating;
}
});

Logs

New Topic rating view(IE 11) :
New Topic rating view(Chrome) :

IE 11 does not have a value property.
value property is not pass

1 Like

@111 Fantastic. Thanks for writing this up. I’ll take a look at it on the weekend.

@111 Taking a look at this now I can’t reproduce this.

However I’ve added in some code to ensure the value attribute is always set.

Thank you
I solved

1 Like