Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ldhasson opened this issue Feb 7, 2022 · 4 comments

Comments

@ldhasson
Copy link

ldhasson commented Feb 7, 2022

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.

@wkeese
Copy link
Member

wkeese commented Feb 8, 2022

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.

@ldhasson
Copy link
Author

ldhasson commented Feb 8, 2022 via email

@ldhasson
Copy link
Author

ldhasson commented Feb 8, 2022

Hello!

Here are screenshots i am getting when clicking inside the tooltip DIV (just regular 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?

@wkeese
Copy link
Member

wkeese commented Feb 9, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants