Closed Tofandel closed 2 years ago
As I'm not exactly sure why __unset__
has been added as default value instead of just leaving it undefined
, I made 2 PRs, one keeping it, and one removing it entirely
It's been a while but if I remember correctly it's set to __unset__
because undefined
is also a value that can be passed to props and I needed a way to know if a prop was passed.
Do you have an example or use case of when would undefined
be passed to a prop?
Because with a quick test, a prop without a type passed like a boolean prop (eg: <Filepond allow-multiple>
) will be an empty string and not undefined so that seems like something that's just not needed and instead causes problems
The only way to pass undefined is <Filepond :allow-multiple="undefined">
but then this should be respected, because it's a way to unset a prop in vue <Filepond :allow-multiple="multiple ? true : undefined">
(or passing down a prop with no default value)
In general, js is gifting us with both undefined
and null
in comparison with other languages and so undefined
is used to unset and an unset value can have a fallback to default, as opposed to null
which is to set no value which shouldn't fallback to default. So adding an intermediate string for this is a wrong usage of js
having capture="unset" prevents safari on iOS from prompting image gallery, files or camera select and defaults it to capture, there should be no capture tag by default.
Pushed release 7.0.3
which should fix the issue.
Is there an existing issue for this?
Have you updated Vue FilePond, FilePond, and all plugins?
Describe the bug
__unset__
default prop value is being displayed in HTML attributes, which wasn't the case in v6 (vue 2)This is also a big problem if using the validate-file-type plugin and not declaring an accepted type, all files will be rejected instead of all accepted![image](https://user-images.githubusercontent.com/6115458/157067024-b282bd9a-2559-4ec9-a6bc-edf688dc06a8.png)
Reproduction
https://codesandbox.io/s/vue-filepond-live-demo-forked-7fpymj?file=/src/main.js
Environment