Skip to content

Image Picker Component Implementation For Profile Header Layout Editor - #178

Open
betsyecastro wants to merge 26 commits into
developfrom
profile-header-layout-editor
Open

betsyecastro wants to merge 26 commits into
developfrom
profile-header-layout-editor

Conversation

@betsyecastro

@betsyecastro betsyecastro commented Feb 20, 2025

Copy link
Copy Markdown
Contributor

image

Scroll down to see the latest updates to this branch ⬇️ ⬇️ ⬇️

@betsyecastro betsyecastro self-assigned this Feb 20, 2025
@shukla-m
shukla-m self-requested a review February 20, 2025 21:06
@betsyecastro
betsyecastro requested a review from wunc February 20, 2025 21:06
@betsyecastro
betsyecastro force-pushed the profile-header-layout-editor branch 3 times, most recently from 8eab4b3 to bfd25f8 Compare March 6, 2025 17:38
@betsyecastro betsyecastro added the ✨ enhancement New feature or request label Sep 26, 2025
@betsyecastro

Copy link
Copy Markdown
Contributor Author

🔀 Merged develop to update branch and 🐛 fixed broken image after saving in the image picker

The image was uploading correctly, but after saving, the page would redirect and show a broken image until it was manually refreshed.

Used Claude 🤖 to help identify the issue, which was caused by the picker form using method="GET" along with the global replace-icon handler declared in app.js, which was triggering the form submission and bypassed wire:submit.prevent, redirecting to the profile page while the Livewire save() request was still running.

Changes:

  • Removed method="GET", @csrf, and the file input name since Livewire doesn’t need them.
  • Updated replace_icon to add a conditional that skips the native submit fallback for Livewire forms.
  • Replaced data-toggle="replace-icon" on the Save button with wire:loading for the spinner and disabled the button while saving to prevent double submissions.
  • Fixed the upload validation rules since uploadedImageRules() returns an array and can’t be used directly inside a rule string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant