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)
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:
src/components/Button/Button.jsx(anchor branch, ~L30–43):onClickcallse.preventDefault(), then, since no editor window exists yet,const newWindow = window.open(href, "_blank")→ tab A opens →setEditorWindowReference(newWindow)→onClick(e)(pickEditor →editTask).src/services/Editor/Editor.jseditTask(~L84–90): "if we've already opened an editor window, close it" →editorWindowReference.close()→ tab A closes →editorWindowReference = window.open(constructEditorUri(...)).- The browser's transient user activation was consumed by the first
window.open, so the second call is treated as a pop-up and returnsnull. 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.jsxshould not callwindow.openitself — justpreventDefault()and delegate toonClick, lettingeditTaskopen the tab (its existing close-old-tab logic then behaves as intended); oreditTaskshould skip the close/re-open when the currenteditorWindowReferencewas just opened for this same task (e.g. compare URL, or haveButton.jsxpass the freshly opened window through soeditTasknavigates 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.openthen succeeds). - Use the Classic/Edit Mode toggle (embedded Rapid).
- Challenge authors: put an editor link in the task instruction;
MarkdownContentrenders it as a normaltarget="_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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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