Skip to content

Inline events count label clicks twice #131

Open

Description

@simpleanalytics-agent

What

One click on a <label> inside an element with data-simple-event sends the event twice.

  • Expected: one click sends one event.
  • Current: <div data-simple-event="plan_toggle"><label for="y">Yearly</label><input id="y" type="radio"></div> sends two plan_toggle events per click. The browser fires a click on the label and then a forwarded click on the input, and both reach the script. The same happens when the label wraps the input.

Why

Checkbox, radio and toggle UIs inside tagged elements report twice the real number of events.

Notes

Inline events are new in the main script in v12 (scripts#40). Reported in this review thread. Independent clicks in quick succession must still be counted.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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