primereact
primereact copied to clipboard
FileUpload: Ability to remove file in basic mode - #2991
This PR adds a feature to the FileUpload component that allows the basic variant to support file removal (clear functionality). To ensure backward compatibility for existing users, a new prop, showRemoveButton, has been introduced. This prop enables this new file removal capability when set to true.
In addition to this, we've introduced the removeButtonSeverity prop to allow customization of the remove button's color. This is particularly useful for aligning with different design systems and color schemes, as the default "danger" color may not always be preferred. By using the library's own Button component, users can take full advantage of its features, including severity customization.
Key Changes:
-
Feature Addition:
showRemoveButton: A new prop that controls the visibility of the remove button in thebasicmode. Default istrue.removeButtonSeverity: A new prop to customize the severity (color) of the remove button. Valid values are"secondary","success","info","warning","danger","help", and"contrast". Default is"danger".
-
Documentation:
- Updated the documentation to include the new props and their usage scenarios.
-
Testing:
- Conducted testing to ensure that the new functionality works as expected without impacting existing behavior for users who do not opt into this new feature.
Tasks Completed:
- Implemented the
showRemoveButtonandremoveButtonSeverityprops. - Updated TypeScript definitions to include the new props.
- Adjusted the
FileUploadcomponent to support these features. - Updated documentation accordingly.
- Performed testing to validate the changes.
I’m open to any feedback or changes needed. Please let me know how I can further assist in this process.
Fixes #2991
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| primereact | ⬜️ Ignored (Inspect) | Visit Preview | Aug 22, 2024 4:56pm | |
| primereact-v9 | ⬜️ Ignored (Inspect) | Visit Preview | Aug 22, 2024 4:56pm |
Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.
Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.
Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.
Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.
Looks like the build is failing?
Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.
Looks like the build is failing?
It was a format problem, I already corrected the linking issue, it makes me feel bad, not because what the format is or because it doesn't detect it
I'm sorry, but after discussing with my colleagues, we have decided not to approve this proposal. We appreciate your effort, but we believe users can achieve similar functionality through custom or advanced versions.
https://primereact.org/fileupload/#advanced https://primereact.org/fileupload/#template https://primereact.org/fileupload/#custom