SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.9k stars 1.23k forks source link

Corrupt labeling of CustomScale at RangeSlider with newest UI5 patch level #3480

Closed marc4F closed 2 years ago

marc4F commented 2 years ago

OpenUI5 version: 1.71.43

Browser/version: Chrome 99.0.4844.51

Any other tested browsers/devices: Same problem exists for firefox, safari

Steps to reproduce the problem:

  1. Add a sap.m.RangeSlider
    <RangeSlider id="rangeSlider" range="0,12" min="0" max="12" step="1" enableTickmarks="true"/>
  2. Set a custom scale to sap.m.RangeSlider
    
    this.oCustomScale = sap.ui.core.Element.extend("sap.xx.custom.CustomScale", {
                metadata: {
                    interfaces: [
                        "sap.m.IScale"
                    ],
                    library: "sap.xx.custom"
                }
    });

this.oCustomScale.prototype.getTickmarksBetweenLabels = function () { return 2; }; this.oCustomScale.prototype.calcNumberOfTickmarks = function () { return 12; }; this.oCustomScale.prototype.getLabel = function (iValue) { if (parseInt(iValue, 10) === 12) { return "Max"; } else { return iValue; } }; this.getView().byId("rangeSlider").setScale(new this.oCustomScale());


What is the expected result?
The custom scale gets applied correctly. Like it worked in previous OpenUI5 versions. For example 1.71.25 did work. 
But also newest version 1.99.0 does look like expected:
![image](https://user-images.githubusercontent.com/8481815/158588694-cec2e1dd-fe64-46c2-bf43-e8d62b2352c8.png)

What happens instead?
For the version 1.71.43, the "0" gets rendered double. And instead of just showing "Max" as custom label, it also shows 12.
![image](https://user-images.githubusercontent.com/8481815/158589260-4073416d-d1ca-48d0-9299-e5434021fcb4.png)

Any other information?
I customized the css for the labels. If anyone else searches for a temporary fix:

.sapMSliderLabels{ visibility: hidden; }

ndeshev commented 2 years ago

Hello @marc4F

Thank you for sharing this finding, I was able to reproduce the issue. I've created an internal incident 2270029035. The status of the issue will be updated here in GitHub.

Regards, Nikolay

MapTo0 commented 2 years ago

Dear @marc4F

We are currently producing the last patch for 1.71 and later patches will be produced on a request. Are you sure you want the fix in 1.71? We strongly recommend upgrading your UI5 versions so you can continue receiving fixes regularly.

Regards, Martin

marc4F commented 2 years ago

Hi @MapTo0

we are stuck for a while at 1.71. Can't update anytime soon. Could you please fix it for 1.71 too.

Thanks!

Best regards Marco