Skip to content

Automated events prevent links from opening #51

@pavish

Description

@pavish

We have automated events enabled in our website mathesar.org.

I noticed that the anchor buttons don't seem to perform navigation on our site in UAE, where I'm currently residing. This is because the click events are prevented, and the navigation is assigned to a callback which happens only when the event is sent i.e when the image 'simple.gif' loads or if an error is thrown, both of which don't seem to be triggering the callback.

Here's an issue in our repo with more details: mathesar-foundation/mathesar-website#127

Update:

Strike my initial reasoning, I went through the auto-events code and found this:

      var callback = function () {
        if (!sent && !element.hasAttribute("target"))
          document.location = element.getAttribute("href");
        sent = true;
      };

The anchor links in our site, had target attributes for _self.

<a ... target="_self" href="...">

This prevented the callback from being called, since they had a target attribute.

And since the onClick event returns false, chrome did not navigate to the href. Somehow, some versions of Firefox seemed to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions