dojo icon indicating copy to clipboard operation
dojo copied to clipboard

Digit highjacks the click handler for some users but not others, on exact same browser config and version

Open ldhasson opened this issue 4 years ago • 4 comments

In dijit.js, the function stopNativeEvents() is triggered on some browsers but not others. This is not related to a browser version or something, so this is very strange:

  • Two users with the exact same Chrome version, one experiences the issue and the other not.
  • This seems quite unfrequent: reported by 3 users amongst over 100 using our app
  • Experiences on Chrome and Edge
  • Looked at permissions of plugins to see if this could affect the behavior but couldn't discern any difference.

Triggering code:

function makeTooltipDialog(elementId, content) {
  var that = this;
  require(["dijit/TooltipDialog","dijit/popup","dojo/on","dojo/dom"], function(TooltipDialog, popup, on, dom) {
    that.tooltipDialog = dojoDijit.byId(elementId+"_TD");
    if (that.tooltipDialog != null)
     {
       console.warn("DESTROYING tooltipDialog "+elementId);
       that.tooltipDialog.destroy();
       that.tooltipDialog = null;
     }
    that.tooltipDialog = new TooltipDialog({
          id: elementId+"_TD",
          content: content,
          onMouseLeave: function(){
            popup.close(that.tooltipDialog);
          }
    });
    on(dojoDom.byId(elementId), 'click', function(){
        dojoDijit.popup.open({
              popup: that.tooltipDialog,
              around: dom.byId(elementId)
          });
      });
  });
 };

On some user accounts, this results in a click-handler being added to the element and gobbling up events, while for other users, the click handler is never instantiated. I traced this to clickTracker being set.

Again, this behavior has been observed with users on the exact same browser setup as other users who do not experience this issue.

Thank you.

ldhasson avatar Feb 07 '22 22:02 ldhasson

You should set a breakpoint to figure out who is calling stopNativeEvents() at all. There's no way to tell from your code snippet, and I don't see it getting called at all.

The problem might be related to focus jumping to the popup after it's opened, and the timing of the click (how long between mousedown and mouseup), although that doesn't really make sense either because the click event (and the popup.open() call) shouldn't happen until after mouseup.

wkeese avatar Feb 08 '22 01:02 wkeese

Hello Bill,

I will check the stack trace and try to gather additional insights.

I am not sure this is timing related though but will check that angle.

Thank you,

Sent from my BlackBerry - the most secure mobile device

From: @.*** Sent: February 7, 2022 20:41 To: @.*** Reply-to: @.*** Cc: @.; @. Subject: Re: [dojo/dojo] Digit highjacks the click handler for some users but not others, on exact same browser config and version (Issue #420)

You should set a breakpoint to figure out who is calling stopNativeEvents() at all. There's no way to tell from your code snippet, and I don't see it getting called at all.

The problem might be related to focus jumping to the popup after it's opened, and the timing of the click (how long between mousedown and mouseup), although that doesn't really make sense either because the click event (and the popup.open() call) shouldn't happen until after mouseup.

— Reply to this email directly, view it on GitHubhttps://github.com/dojo/dojo/issues/420#issuecomment-1032124468, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AADEHB5IFXKZXKJU2WFKBBLU2BYC7ANCNFSM5NYYFZ4Q. You are receiving this because you authored the thread.Message ID: @.***>

ldhasson avatar Feb 08 '22 06:02 ldhasson

Hello!

Here are screenshots i am getting when clicking inside the tooltip DIV (just regular <A href=""></A> stuff). I put a breakpoint at the beginning of the method, and at the beginning of the handler.

Clip0001

Clip0002

Clip0003

Clip0004

The really strange thing is that when i run this code from my VM, in the same corporate environment as this user, on the exact same Chrome version, none of the breakpoints come up: doClicks() is not being called at all.

I am accessing this VM via VPN+Remote Desktop while the user is straight at a desktop at his desk, so i'd think i'd be the one more prone to timing issues?

ldhasson avatar Feb 08 '22 16:02 ldhasson

I just realized that stopNativeEvents() and doClicks() are part of dojo/touch.js.

That whole module has probably outlived its usefulness as you can get the same effect without javascript, see https://developers.google.com/web/updates/2013/12/300ms-tap-delay-gone-away.

I suggest you just disable the module. Whatever your build system is you could remap dojo/touch to an empty file, or something like that.

wkeese avatar Feb 09 '22 00:02 wkeese