Start a new topic

Touch events on IconTabBar and Chrome 55

Hello and happy new year to everyone :)


Issues have been reported when using UI5 1.38 sap.m.icontabbar  and Chrome 55.


Until this issue is fixed, we have two workarounds.


Quick workaround:    set chrome://flags/#touch-events  to Disabled.


image



Not-so-quick workaround:  implement the code below in each of your apps.

  

/**
 * Fix for issues in Chrome 55 with different pointer event handling
 */

if (typeof(NeptSoftFixes) != "object") {
    NeptSoftFixes = {};
}

sap.ui.getCore().attachInit(function() {
    setTimeout(function() {
        
        // place all your IconTabBar elements in this array
        NeptSoftFixes.IconTabBar_toFix = [oItbList, oItbEmp];

        // place the fix method in the onAfterRendering for the IconTabBar controls
        NeptSoftFixes.IconTabBar_toFix.forEach(function(iconTabBar) {
            iconTabBar.addEventDelegate({
                "onAfterRendering": function(event) {
                    NeptSoftFixes.pointerDownForIconTabFilter();
                }
            }, this);
        });
        
        // also call the fix method initially to cover controls that might have been rendered already
        NeptSoftFixes.pointerDownForIconTabFilter();

    }, 200);
});

NeptSoftFixes.pointerDownForIconTabFilter = function() {

    NeptSoftFixes.IconTabBar_toFix.forEach(function(iconTabBar) {

        iconTabBar.getItems().forEach(function(iconTabFilter) {
            if (iconTabFilter.getMetadata()._sClassName != "sap.m.IconTabFilter") {
                return; // only process IconTabFilter items
            }

            var domRef = iconTabFilter.getDomRef();
            if (domRef === null) {
                return;
            }

            var count = domRef.getAttribute("neptune-fix-chrome55-pointerdown");
            if (!count) {
                count = 0;
            } else if (count >= 1) {
                return; // only add event listener once
            }

            console.log("adding event listener to iconTabFilter " + iconTabFilter.getId());
            domRef.addEventListener("pointerdown", function() {
                console.log("pointerdown event ... executing " + iconTabBar.getId() + ".setSelectedItem(" + iconTabFilter.getId() + ")");
                iconTabBar.setSelectedItem(iconTabFilter);
            });
            domRef.setAttribute("neptune-fix-chrome55-pointerdown", count + 1);

        });

    });

};

  


If this problem is not fixed from Chrome/UI5 end then we will look into make this rendered from the Neptune server so that you do not have to implement the fix in each of your apps.


Kind regards,

Julian


1 person has this question

Hi everyone,


All UI5 versions have been updated by SAP with a fix for the "Chrome 55 touch issue".  

Neptune UXP 4.0 SP03 will include UI5  1.38.latest / 1.40.latest / 1.42.latest   which will contain this fix.


When ?    before end of Q1/2017


Kind regards,

Julian


1 person likes this

Hi Julian

Can you describe what the issues were that were reported?

Hi Duncan,


basically the press event of sap.m.IconTabFilter did not fire in any UI5 1.38 sap.m.IconTabBar using Chrome 55.


Kind regards

Christoph


1 person likes this
Login or Signup to post a comment