From ba22ed273351087615d710c6448f1591348b66d8 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Fri, 30 Jan 2026 22:44:07 +0000 Subject: [PATCH] Make photo selector show preview thumbnails --- html/static/js/photo-upload.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/html/static/js/photo-upload.js b/html/static/js/photo-upload.js index 0e277ed0..29abfd3a 100644 --- a/html/static/js/photo-upload.js +++ b/html/static/js/photo-upload.js @@ -14,7 +14,7 @@ class PhotoUpload extends HTMLElement { const photoInput = this.shadowRoot.querySelector('#photos'); // Handle photo selection - photoInput.addEventListener('change', this._handlePhotoSelection); + photoInput.addEventListener('change', () => {this._handlePhotoSelection()}); // Handle drag and drop const photoDropArea = this.shadowRoot.querySelector('#photoDropArea'); @@ -97,8 +97,8 @@ class PhotoUpload extends HTMLElement { * Handle photo selection and preview */ _handlePhotoSelection() { - const photoInput = document.getElementById('photos'); - const photoPreviewContainer = document.getElementById('photoPreviewContainer'); + const photoInput = this.shadowRoot.querySelector('#photos'); + const photoPreviewContainer = this.shadowRoot.querySelector('#photoPreviewContainer'); // Clear previous previews photoPreviewContainer.innerHTML = '';