Fix Enter on the marketplace Buy button opening details instead of buying
Maintainers usually reply within 1 day
@developedbyBob is already working on this.
Since Nov 1, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- next.js, react, typescript
- Domain
- accessibility, frontend, testing
Research direction
Open frontend/src/components/marketplace/MarketplaceListingCard.tsx and look at the card's onKeyDown around line 50 and the nested Buy button around lines 127-134. Guard the card handler so it returns early when e.target !== e.currentTarget. Then run cd frontend && npx vitest run src/components/marketplace/MarketplaceListingCard.test.tsx and update MarketplaceListingCard.test.tsx to assert Enter/Space on Buy calls neither onSelect nor preventDefault, while the card itself still selects; add a changelog fragment in changelog.d/.
Written by the indexing model from the issue text.
Description
What is wrong / what to do
MarketplaceListingCard is a div role="button" with an onKeyDown handler that runs preventDefault(); onSelect() on Enter or Space. The Buy <button> sits inside the card, so its keydown bubbles up to that handler. A keyboard user who focuses Buy and presses Enter gets the detail view, and preventDefault suppresses the button's own click, so onBuy never runs. Make the card handler ignore key events that did not start on the card itself (if (e.target !== e.currentTarget) return;).
Where in the code
frontend/src/components/marketplace/MarketplaceListingCard.tsx:50— cardonKeyDownfrontend/src/components/marketplace/MarketplaceListingCard.tsx:127-134— nested Buy button;e.stopPropagation()is only ononClick, not on keydown- Rendered by
frontend/src/app/marketplace/page.tsx:24
How to reproduce, or the test command
Manual: run npm run dev, open /marketplace, Tab to a listing's Buy button and press Enter. The detail view opens and no purchase starts.
# needs #56 (Enable JSX in vitest) merged first; test file starts with `// @vitest-environment jsdom`
cd frontend && npx vitest run src/components/marketplace/MarketplaceListingCard.test.tsx
Verified on main: fireEvent.keyDown(buyButton, { key: 'Enter' }) calls onSelect once and reports the event as defaultPrevented.
Done when
-
keyDownEnter or Space on the Buy button does not callonSelectand does not callpreventDefault -
keyDownEnter or Space on the card itself still callsonSelect - Clicking Buy still calls
onBuyand notonSelect - Tests added or updated, and the command above passes
- Changelog fragment in
changelog.d/
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 3
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from BeyondITL/contentine-create
-
good first issue level: 1 ui
Difficulty 2/5 1-3 hours Newbie friendliness 94/100
BeyondITL/contentine-create#58 ·
Maintainers usually reply within 1 day
-
Enable JSX in vitest so React component tests can runPossibly taken @29miaoet claimed this 7 days ago. Openclaimed good first issue level: 1 testing
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
BeyondITL/contentine-create#56 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
good first issue level: 1 testing
Difficulty 2/5 1-3 hours Newbie friendliness 94/100
BeyondITL/contentine-create#55 ·
Maintainers usually reply within 1 day
-
good first issue level: 1 testing
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
BeyondITL/contentine-create#54 ·
Maintainers usually reply within 1 day
-
engine good first issue level: 1
Difficulty 2/5 1-3 hours Newbie friendliness 94/100
BeyondITL/contentine-create#53 ·
Maintainers usually reply within 1 day
All issues in BeyondITL/contentine-create
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
earendil-works/pi-claude-code#36 ·
Maintainers usually reply within 6 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Resources: New work of jabodetabekPossibly taken @rmt-svc claimed this today. Openresources
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
railmapgen/rmp-gallery#4167 ·
Maintainers usually reply within 2 days
-
documentation p1
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
microsoft/monaco-editor#5577 ·
Maintainers usually reply within 1 day