You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As described in #4173 , since primereact fileupload component does not have out of the box validation for file format and no of files ,
We had developed custom validation functional component , which was working fine till 7.2.0 release, but after upgrading to 8.7.3 and even tested in 9.2.1, its broken as we have to pass the ref of the file upload to this component and then we are getting errors like : (based on issues #2893 , #3045 , #3043 - shows as fixed but still does not work in 8.7.3 and 9.2.1 )
ref.current.setstate is not a function ,as in below code
For 1) , we found the alternate solution in 9.2.1, by using fileUploadComponentRef.current.setFiles(validFiles) , but what to do if we cannot upgrade to 9.2.1 and are on version 8.7.3 currently ?
And for the below, when we want to show the error message whenever any validation fails like invalid file is selected , then with 8.7.3 & even 9.2.1, our code is broken and we cannot see messagesUI inside current as we used to see till version 7.2.0.
cannot read show of undefined ( ref.current.messagesUI ) as in below code
So how to handle this showing of error messages in 8.7.3 and 9.2.1.
Currently, we are on 8.7.3 and cannot easily upgrade to 9.2.1 , so try to provide fix for both .
Suppose, if I have my own message component - I can show there but some error messages like in a) below (coming out of the box ) will come at one place and others which are handled by my custom code will come at another place -which is inconsistent ?
a) with maxFileSize prop and corresponding message props like invalidFileSizeMessageDetail & invalidFileSizeMessageSummary configured, fileupload component will take care of showing the error message as soon as we select the files in a particular place which I assume is the messagesUI in version 7.2.0
Reproducer
No response
PrimeReact version
8.7.3, 9.2.1
React version
17.x
Language
ES6
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered:
melloware
changed the title
Unable to display validation messages in fileUpload component
FileUpload: Ability to display and control error messages
Mar 21, 2023
Issue tracker is used for defects only as part of our commitment to quality and continuous improvement in all areas. Enhancements are collected as valuable community feedback and managed internally so moving this enhancement ticket to our internal project management backlog.
Describe the bug
As described in #4173 , since primereact fileupload component does not have out of the box validation for file format and no of files ,
We had developed custom validation functional component , which was working fine till 7.2.0 release, but after upgrading to 8.7.3 and even tested in 9.2.1, its broken as we have to pass the ref of the file upload to this component and then we are getting errors like : (based on issues #2893 , #3045 , #3043 - shows as fixed but still does not work in 8.7.3 and 9.2.1 )
fileUploadComponentRef.current.setState({ files: validFiles });
For 1) , we found the alternate solution in 9.2.1, by using fileUploadComponentRef.current.setFiles(validFiles) , but what to do if we cannot upgrade to 9.2.1 and are on version 8.7.3 currently ?
And for the below, when we want to show the error message whenever any validation fails like invalid file is selected , then with 8.7.3 & even 9.2.1, our code is broken and we cannot see messagesUI inside current as we used to see till version 7.2.0.
fileUploadComponentRef.current.messagesUI.show({
severity: 'error',
summary: ,
});
So how to handle this showing of error messages in 8.7.3 and 9.2.1.
Currently, we are on 8.7.3 and cannot easily upgrade to 9.2.1 , so try to provide fix for both .
Suppose, if I have my own message component - I can show there but some error messages like in a) below (coming out of the box ) will come at one place and others which are handled by my custom code will come at another place -which is inconsistent ?
a) with maxFileSize prop and corresponding message props like invalidFileSizeMessageDetail & invalidFileSizeMessageSummary configured, fileupload component will take care of showing the error message as soon as we select the files in a particular place which I assume is the messagesUI in version 7.2.0
Reproducer
No response
PrimeReact version
8.7.3, 9.2.1
React version
17.x
Language
ES6
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: