Skip to content

v1.0.5 — capture-phase click + test-mode diagnostics

Choose a tag to compare

@jcasey76 jcasey76 released this 21 May 14:19
· 27 commits to main since this release

Fixes silent click-trigger failures on Divi pages + adds debugging console logs in test mode.

What changed

  • The click-trigger listener now runs in capture phase at the document root. Previously it ran in bubble phase, which meant any Divi module along the click path that calls `event.stopPropagation()` would swallow the event before our handler ever saw it. Capture phase fires first, before any descendant can stop the event.
  • Test-mode console diagnostics. While test mode is on, the plugin logs to the browser DevTools console (F12 → Console):
    • On init: the triggers / frequency / testMode state.
    • On click-trigger setup: how many elements currently match the configured selector (or a warning if the selector is invalid CSS).
    • On every click anywhere on the page: the target element and whether it matched the configured selector.
    • When the popup shows.
  • The live site emits nothing — diagnostics are scoped to test mode only.

Debugging a click trigger that isn't firing

  1. Enable test mode on the page with your trigger button.
  2. Open DevTools → Console (F12 → Console tab).
  3. Reload the page. You should see `[AQM Popup] Initialized.` and a line listing how many elements match your selector.
  4. Click your trigger button. A line like `[AQM Popup] Click event — target: matched selector? true` should appear.
  5. If `matched selector?` is `false`, your selector doesn't match the button — sanity-check by running `document.querySelectorAll('your-selector')` in the console.