Skip to content

fix(events): clear ?event= param when its modal closes - #535

Merged
mohanadft merged 1 commit into
mainfrom
fix/events-clear-link-param-on-close
Aug 31, 2026
Merged

fix(events): clear ?event= param when its modal closes#535
mohanadft merged 1 commit into
mainfrom
fix/events-clear-link-param-on-close

Conversation

@mohanadft

Copy link
Copy Markdown
Collaborator

Summary

  • The ?event=<id> param added by the event modal's "copy link" button (feat(events): add shareable per-event links #534) was staying in the URL after the modal was closed, even though it no longer pointed at anything visible on the page.
  • Adds clearEventLinkParam() (src/utils/copyAnchorLink.ts), called from both /events and /events-new's modal close handlers, which strips the event param via history.replaceState while preserving any other query params/hash.

Test plan

  • Visit a copied event link (.../events?event=<id>), confirm the modal auto-opens.
  • Close it (X button, Escape, or clicking the backdrop) and confirm the URL reverts to the plain page path (no ?event=).
  • Repeat on /events-new.
  • pnpm check passes.

The query param added by the share-link "copy link" button was
sticking around in the URL after closing the modal, even though the
event was no longer on screen. Strip it via clearEventLinkParam() in
both close handlers.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying website with  Cloudflare Pages  Cloudflare Pages

Latest commit: be94c28
Status: ✅  Deploy successful!
Preview URL: https://93ede3da.website-aun.pages.dev
Branch Preview URL: https://fix-events-clear-link-param.website-aun.pages.dev

View logs

@mohanadft
mohanadft merged commit a6f1999 into main Aug 31, 2026
5 checks passed
@mohanadft
mohanadft deleted the fix/events-clear-link-param-on-close branch August 31, 2026 13:38
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

Successfully merging this pull request may close these issues.

1 participant