diff --git a/packages/main/src/RatingIndicator.hbs b/packages/main/src/RatingIndicator.hbs
index 1eb32582fb1a3..9246415d8faca 100644
--- a/packages/main/src/RatingIndicator.hbs
+++ b/packages/main/src/RatingIndicator.hbs
@@ -3,7 +3,7 @@
aria-roledescription="{{_ariaRoleDescription}}"
aria-valuemin="0"
aria-valuenow="{{value}}"
- aria-valuemax="{{maxValue}}"
+ aria-valuemax="{{max}}"
aria-orientation="horizontal"
aria-disabled="{{_ariaDisabled}}"
aria-readonly="{{ariaReadonly}}"
diff --git a/packages/main/src/RatingIndicator.js b/packages/main/src/RatingIndicator.js
index 14b4ffed1122f..3231855711d31 100644
--- a/packages/main/src/RatingIndicator.js
+++ b/packages/main/src/RatingIndicator.js
@@ -51,8 +51,9 @@ const metadata = {
* @type {Integer}
* @defaultvalue 5
* @public
+ * @since 1.0.0-rc.15
*/
- maxValue: {
+ max: {
type: Integer,
defaultValue: 5,
},
@@ -188,7 +189,7 @@ class RatingIndicator extends UI5Element {
calcState() {
this._stars = [];
- for (let i = 1; i < this.maxValue + 1; i++) {
+ for (let i = 1; i < this.max + 1; i++) {
const remainder = Math.round((this.value - Math.floor(this.value)) * 10);
let halfStar = false,
tempValue = this.value;
@@ -240,7 +241,7 @@ class RatingIndicator extends UI5Element {
if (down && this.value > 0) {
this.value = Math.round(this.value - 1);
this.fireEvent("change");
- } else if (up && this.value < this.maxValue) {
+ } else if (up && this.value < this.max) {
this.value = Math.round(this.value + 1);
this.fireEvent("change");
}
diff --git a/packages/main/test/pages/RatingIndicator.html b/packages/main/test/pages/RatingIndicator.html
index 13b1315e8a325..4a481834ae0d6 100644
--- a/packages/main/test/pages/RatingIndicator.html
+++ b/packages/main/test/pages/RatingIndicator.html
@@ -24,18 +24,18 @@
-
-
- - + +
diff --git a/packages/main/test/specs/RatingIndicator.spec.js b/packages/main/test/specs/RatingIndicator.spec.js index 09ae67437e23a..0b215b0adc96b 100644 --- a/packages/main/test/specs/RatingIndicator.spec.js +++ b/packages/main/test/specs/RatingIndicator.spec.js @@ -13,7 +13,7 @@ describe("Rating Indicator general interaction", () => { assert.strictEqual(ratingIndicator.shadow$$(".ui5-rating-indicator-icon").length, 5, "Basic rating indicator renders 5 stars"); }); - it("Tests max-value property", () => { + it("Tests max property", () => { const ratingIndicator = browser.$("#rating-indicator2"); assert.strictEqual(ratingIndicator.shadow$$(".ui5-rating-indicator-icon").length, 10, "Basic rating indicator renders 10 stars");- - + +