FileUpload shouldn't post to url
if none is provided
#7180
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
The
FileUpload
component provides an optionalurl
parameter that defaults tonull
if unspecified. However, it will always post to this url, so leaving it unpopulated causes errors to appear in the console:Selecting a document produced the console error:
My expectation is that no url specified means no post should occur.
Potential PR
I think this is the only line to change?
primevue/packages/primevue/src/fileupload/FileUpload.vue
Line 225 in 8cf3f0c
It just needs to change to conditionally check for null, right?
Pull Request Link
No response
Reason for not contributing a PR
Other Reason
No response
Reproducer
https://stackblitz.com/edit/primevue-4-vite-issue-template-3jqjjbaa?file=src%2FApp.vue
Environment
Macos / node 22.11.0
Vue version
3.4.27
PrimeVue version
4.1.1
Node version
22.11.0
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
No POST request made, since no
url
was specifiedThe text was updated successfully, but these errors were encountered: