Skip to content

Fix Add photo button to trigger hidden file input in MapView#75

Merged
roy-bme merged 1 commit into
claude/blackmass-corporate-website-caGTRfrom
codex/fix-add-photo-button-functionality
May 14, 2026
Merged

Fix Add photo button to trigger hidden file input in MapView#75
roy-bme merged 1 commit into
claude/blackmass-corporate-website-caGTRfrom
codex/fix-add-photo-button-functionality

Conversation

@roy-bme
Copy link
Copy Markdown
Owner

@roy-bme roy-bme commented May 14, 2026

Motivation

  • The photo action in the map edit drawer did not reliably open the file picker because the visible button/label was not programmatically wired to the hidden file input, preventing the onChange upload flow from starting.

Description

  • Added fileInputRef = useRef<HTMLInputElement | null>(null) and a handleAddPhotoClick callback that logs and calls fileInputRef.current?.click() to open the picker.
  • Replaced the label-wrapped <input> with an explicit clickable <button onClick={handleAddPhotoClick}> and a separate hidden <input ref={fileInputRef} type="file" ...> so the click target and input are reliably connected.
  • Kept the existing onChange handler and handlePhotoUpload flow (Supabase upload → public URL → append to business.photos → UI update) unchanged.
  • Included a temporary console.log("[MapView] Add photo button clicked") in the click handler to aid manual verification in the browser.

Testing

  • Ran TypeScript typecheck successfully via npm run typecheck.

Codex Task

@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blackmasswebsite Ready Ready Preview, Comment May 14, 2026 6:08pm

Request Review

@supabase
Copy link
Copy Markdown

supabase Bot commented May 14, 2026

This pull request has been ignored for the connected project ipqmdinidqpmchggjdov because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@roy-bme roy-bme merged commit 477f412 into claude/blackmass-corporate-website-caGTR May 14, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant