maproulette / maproulette/maproulette-frontend

Edit in iD/Rapid button opens nothing: Button.jsx opens the editor window, then editTask() closes it and re-opens (blocked as pop-up)

Open Beginner friendly
#2,923 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
167
Forks
39
Avg merge
16h 34m
Merged PRs (30d)
11

Description

What happened

On the task page, clicking Edit in iD (web editor) (and Edit in Rapid) does nothing: no editor tab appears. Chrome shows a "pop-up blocked" icon in the address bar. Cmd/Ctrl+click is swallowed too. Right-click → "Open Link in New Tab" works, and the button starts working once the user tells Chrome to always allow pop-ups from maproulette.org.

Environment: maproulette.org v3.18.5 (API 4.10.0), Chrome (current stable) on macOS, signed in, task locked normally. Reproduced on two separate tasks/challenges.

Cause (traced with a window.open hook in the page)

One user click triggers two window.open calls and a close() in between:

  1. src/components/Button/Button.jsx (anchor branch, ~L30–43): onClick calls e.preventDefault(), then, since no editor window exists yet, const newWindow = window.open(href, "_blank")tab A openssetEditorWindowReference(newWindow)onClick(e) (pickEditor → editTask).
  2. src/services/Editor/Editor.js editTask (~L84–90): "if we've already opened an editor window, close it" → editorWindowReference.close()tab A closeseditorWindowReference = window.open(constructEditorUri(...)).
  3. The browser's transient user activation was consumed by the first window.open, so the second call is treated as a pop-up and returns null. Net result for the user: nothing.

Captured sequence from the hook (exact URLs elided):

window.open(<iD url>, "_blank")  -> Window     (Button.jsx)
close() called on that window                  (Editor.js editTask)
window.open(<iD url>)             -> null      (blocked: activation consumed)

So the two code paths fight over the same reference: Button.jsx opens the window and registers it, and editTask immediately treats that registration as a stale editor to be closed before opening its own.

Suggested fix

Have only one place open the window. Either:

  • Button.jsx should not call window.open itself — just preventDefault() and delegate to onClick, letting editTask open the tab (its existing close-old-tab logic then behaves as intended); or
  • editTask should skip the close/re-open when the current editorWindowReference was just opened for this same task (e.g. compare URL, or have Button.jsx pass the freshly opened window through so editTask navigates it instead of opening a new one).
Workarounds for mappers meanwhile
  • Right-click the Edit button → Open Link in New Tab (uses the plain href).
  • Allow pop-ups for maproulette.org in the browser (the second window.open then succeeds).
  • Use the Classic/Edit Mode toggle (embedded Rapid).
  • Challenge authors: put an editor link in the task instruction; MarkdownContent renders it as a normal target="_blank" anchor, which is unaffected.

Reported from a live reproduction while onboarding new mappers to a trail-data challenge; report drafted with Claude Code.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/components/Button/Button.jsx, focusing on the anchor branch around lines 30–43, then trace the delegated onClick into editTask in src/services/Editor/Editor.js around lines 84–90. Verify the fix with the Edit in iD and Edit in Rapid buttons, including Cmd/Ctrl+click, and confirm one editor tab opens without a pop-up block or immediate close.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.