filestack-js
filestack-js copied to clipboard
Warnings not being shown to users
I've set a max filesize on my picker, and am finding recently that when choosing a file that exceeds that limit, nothing happens. It is not accepted (correct behavior), but there's no error shown to users to let them know what happened.
I've also tried using onFileSelected to manually show a warning, and that doesn't work either:
filepickerClient
.picker({
onFileSelected: (file) => {
console.log(file.size);
throw new Error('Not accepted');
},
})
.open();
And I see the filesize in the console, but still I don't get any kind of message in the UI.
@IanVS scroll the browser to top and try again. Looks like its a bug in the positioning of message
@akalongman You're right, the message seems to be positioned at the top of the body or something, so it doesn't show up if the page is scrolled down before the picker modal is opened. The message should be positioned to the top of the viewport (position: fixed, I guess).
I don't think this is an enhancement, it's a bug if users cannot see error messages and are left to wonder why their files are not uploading, right?
Definitely it a bug.
Hi, we'll fix it in future release.
Use this css it will be fixed
.fsp-notifications__container { position: fixed; }

@MuhammadGoharKhan thanks the following worked for me added !important. .fsp-notifications__container { position: fixed !important; }
Any news on this ? The workaround works but it could be fixed at the library level