Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileUpload : Image Upload Error: Previous Image Not Clearing After Upload Failure #7740

Open
MuzammilAsghar0987 opened this issue Feb 27, 2025 · 5 comments
Labels
Type: Bug Issue contains a defect related to a specific component.

Comments

@MuzammilAsghar0987
Copy link

MuzammilAsghar0987 commented Feb 27, 2025

Describe the bug

When clicking on the upload button and encountering an upload error, the previous image remains in the data-pc-section="content" field even after multiple failed attempts. Before the upload, the image selection works fine. However, after an error occurs during the upload process, selecting a new image shows both the previous and the new image. This issue persists across multiple attempts.
Note : multiple prop is false.

Reproducer

https://stackblitz.com/edit/vitejs-vite-j6olr6ee?file=src%2FApp.tsx

System Information

System:
    OS: Windows 10 10.0.17763
    CPU: (6) x64 Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz
    Memory: 8.41 GB / 15.94 GB
  Binaries:
    Node: 20.18.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.21.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 10.8.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.17763.1.0)
    Internet Explorer: 11.0.17763.592
  npmPackages:
    primereact: ^10.9.1 => 10.9.2
    react: ^19.0.0 => 19.0.0
    tailwindcss: ^3.4.17 => 3.4.17

Steps to reproduce the behavior

  1. Select an image to upload.
  2. Encounter an upload error.
  3. Select a new image for upload.
  4. Both the previous and the new images are displayed.

Expected behavior

The previous image should be cleared from data-pc-section="content" after each failed upload, ensuring only the newly selected image is displayed.

@MuzammilAsghar0987 MuzammilAsghar0987 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 27, 2025
@melloware melloware added Status: Needs Reproducer Issue needs a runnable reproducer and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Feb 27, 2025
Copy link

Please fork the Stackblitz project and create a case demonstrating your bug report. This issue will be closed if no activities in 20 days.

@MuzammilAsghar0987
Copy link
Author

MuzammilAsghar0987 commented Feb 28, 2025 via email

@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Reproducer Issue needs a runnable reproducer labels Feb 28, 2025
@melloware
Copy link
Member

melloware commented Feb 28, 2025

@MuzammilAsghar0987 i think you forgot your StackBlitz link?

See your first post Reproducer section is blank?

Image

@MuzammilAsghar0987
Copy link
Author

MuzammilAsghar0987 commented Feb 28, 2025

@melloware
Copy link
Member

Thanks switched it to Bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

2 participants