Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Link and button clicks are triggered twice on touch devices APEX 5.1

Menno HoogendijkMay 19 2017 — edited May 22 2017

I've spend a few hours today on this issue and wondered if anyone else struggled with this too.

When you click a link or button in APEX 5.1 with a touch device, then click events are triggered twice.

Demo (open with touch device): https://apex.oracle.com/pls/apex/f?p=38211:7

I've tested with iphone 6 (safari + chrome) and two android devices (Samsung S7 & Asus tablet both using chrome).

In theme42.js there is a function which I think causes the issue:

    var bindTapToClick = function() {

        var windowsDoesNotSupportTouchProperly =

            (navigator.platform && navigator.platform.toLowerCase().indexOf("win") !== -1);

        if (!Modernizr.touch || windowsDoesNotSupportTouchProperly) {

            return;

        }

        // Time out so that regions which need to render dynamically get hooked into this.

        setTimeout(function() {

            $("a, button").each(function() {

                var el$ = $(this);

                // Apply the "fast click" approach if any of the three conditions are met.

                // - Hammer JS library exists.

                // - The given element is NOT inside of a treeView widget.

                // - The given element is NOT inside of a menuBar widget.

                if (!Hammer || el$.parents(".a-TreeView").length > 0 || el$.parents(".a-MenuBar").length > 0)  {

                    //TODO: Develop a better check for whether or not to use tap-to-click here.

                    return;

                }

                var hammertime = new Hammer(this);

                var hammerMe = this;

                hammertime.on('tap', function (ev) {

                    ev.preventDefault();

                    hammerMe.click();

                });

            });

        }, 500);

    };

I'm trying to find a way to unbind the tap event.

Does anyone know how to make sure the click event is triggered only once per tap/click?

This post has been answered by ShakeebRahman-Oracle on May 22 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 19 2017
Added on May 19 2017
1 comment
565 views