cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Issue with focus, scroll after SAPUI5 upgrade

Sriharsha_C
Associate
Associate
0 Kudos
327

Before SAPUI5 upgrade:
// handle tap for active toolbar, do nothing if already handled
Toolbar.prototype.ontap = function(oEvent) {
if (this.getActive() && !oEvent.isMarked()) {
oEvent.setMarked();
this.firePress({
srcControl : oEvent.srcControl
});
}
};

 

After upgrade of SAPUI5:
y.prototype.ontap = function(t) {
if (this.getActive() && !t.isMarked() || t.srcControl === this._getActiveButton()) {
t.setMarked();
this.firePress({
srcControl: t.srcControl
});
this.focus() ==> problem with this line as the scroll moves to initial position to the top.
}
}


My code:

var template= new sap.m.VBox({
      items: [
        new sap.m.Toolbar({ }),
        new sap.m.Panel({
          expand: [oController.expandPanel, oController],
          expandable: true,
          growing: true,
          headerToolbar: [
            new sap.m.OverflowToolbar({
              active: true,
              growing: true,
              press: [oController.panelSelect, oController],
              content: [
                new sap.m.Text({
                  layoutData: new sap.m.OverflowToolbarLayoutData({
                    priority: sap.m.OverflowToolbarPriority.NeverOverflow
                  }),
                  width: "20rem",
                  wrapping: false,
                  text: "{testModel>localName}",
                }),
                new sap.m.ToolbarSeparator()
               
    });

    var scrollRight1 = new sap.m.ScrollContainer("scrollright", {
      vertical: true,
      horizontal: false,
      height: "200rem",
      content: [new sap.m.VBox({
        id: "scroll",
        width: "100%",
        height: "50%",
      }).bindAggregation("items", "testModel>/danger", Template)]
    });

panelSelect: function (oEvent) {
     // content
    }
 
After press event above the scroll moves to initial position.
before UI5 upgrade everything works perfect with the same code. But after upgrade have an issue in scroll.
Could you please suggest.





View Entire Topic
boghyon
Product and Topic Expert
Product and Topic Expert
0 Kudos

The issue should be fixed by now thanks to the change https://github.com/SAP/openui5/commit/6589001a928be6de9b00cfff69a92223c31fc044 which is available from UI5 1.127 so far. Make sure to upgrade to one of the maintained SAPUI5 versions that is 1.127 or higher.