Skip to content

bug: suggest-a-place dialog accepts any string as a Google Maps link and loses input when the popup is blocked #150

Description

@shauryagangrade

Problem

Two issues in src/components/map/suggest-place-dialog.tsx:85-99:

  1. No URL validationisValid accepts any non-empty string as the "Google Maps link", so typos like google maps com/place/x sail through into the pre-filled GitHub issue.
  2. Popup-blocked data losswindow.open(url, "_blank") returns null when the browser blocks the popup, but the code doesn't check the result: the dialog still closes and everything the user typed is gone with zero feedback.

Suggested fix

  • Validate with URL constructor + require a maps.google. / goo.gl/maps host (or at least any valid http(s) URL)
  • If window.open returns null: keep the dialog open and show a toast + clickable fallback link ("Pop-up blocked — open GitHub here"), so submissions survive

Acceptance criteria

  • Invalid URLs are rejected inline
  • Blocked popups never destroy entered data

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcommunityCommunity / growthgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions