-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
QFile Accept Inconsistency #9385
Comments
You can't see the filename appear, because the selected file's type is not compatible with the Please see the note on If what you want is to just give feedback when the file picking operation is not successful due to an invalid file type, you can listen to the |
I am not reporting so much of an error as I can reporting an inconsistency. At least on Google Chrome, the A bit of an observation I just had after your comment: This issue appears to be browser-specific. As in, Perhaps Google Chrome utilizes the Either way, doing manually validation on the Additionally, it appears to me that the |
I want to make it clear that, Chrome doesn't block you from selecting any file, it's just guiding you to the related files for convenience, you can still select 'all files' from the type dropdown. It's clearly stated above. And I know that it might be confusing how browsers are handling this but this is the way they are doing it, and they do not agree on the way they are doing it, so that is why we are trying to unify that.
Actually, you are proposing to be inconsistent and depend on the browser implementation rather than unifying the behavior across different browsers and platforms. One of the reasons this component exists is handling all of these and unifying the behavior. If you were saying that the file was passing on QFile but not on QUploader, then we would try to solve that because that would be an inconsistency between our components that can be used for similar/shared purposes, and it would be confusing.
Yes, the custom filter is run after predefined filters(accept, size, etc.). Replacing all of them is not a really good idea since some people might want to just add custom filters and not get rid of them. What you can do here is to make a feature request, which allows disabling all/some of the predefined filters.
There is no such thing as native accept validation, there is just guidance towards selecting the correct files, as mentioned at the top. Please let me know if there is any other thing I can help with. |
Also, one good thing to do might be to allow files that have an empty type(i.e. if the file type cannot be recognized by the browser) in the accept filter. Please let me know what you think. |
Describe the bug
When specifying an
accept=
parameter onQFile
, the selectable files vs the files that are accepted by the component are different. In particular, they are inconsistent with a vanilla HTML<input type='file' />
tag.While I am able to select a certain file type (which happens to have a blank mime-type according to Javascript's
File
, though I'm not sure if that is related), the file does not appear in theQFile
component after it is selected.Codepen/jsFiddle/Codesandbox (required)
https://codepen.io/FrederickGeek8/pen/XWMMYLa
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Screenshots
Platform (please complete the following information):
Quasar Version: v1.15.16, v1.14.0
@quasar/app Version: v2.2.6, v2.1.0
Quasar mode:
Tested on:
OS: macOS 11.3 & Codepen
Node: v12.19.0 & Codepen
NPM: 7.14.0 & Codepen
Yarn: N/A
Browsers: Google Chrome Version 90.0.4430.212 (Official Build) (x86_64)
iOS: N/A
Android: N/A
Electron: N/A
Additional context
You can download a test file here: https://gist.github.com/FrederickGeek8/f9cf79e2005af0a7eee8e03ec68b17ba
The text was updated successfully, but these errors were encountered: