-
Notifications
You must be signed in to change notification settings - Fork 3k
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
ion-input cannot be set to type="file" #814
Comments
Thanks for the issue! This appears to be a mistake in our documentation. In particular, the |
I just went to clean up the docs but this is more complicated than I know the process for. If it is really only a documentation issue then there is an issue that the As it may exist in people's projects, it needs to be deprecated gracefully. It is currently mentioned in two properties:
|
The typescript complains about that as:
|
Also experiencing this and it's very unclear as to whether the Can anyone shed some light on this? |
The bottom line is no. Parts of it are implemented but its blocked by the fact that you cant set the |
I think it would be nice to have. I've been using a work around to get the file data. Would the ionic team prefer we use plugins for this or could we expect file to be added to the TextFieldTypes in the future? |
There are any news about this problem? |
Any news of when an update comes out in this regard? It is a native property of the input, we need it |
Alternative: Use native input html with IonButton or custom style <IonButton fill="outline" slot="end" style={{ marginTop: '18px' }}>
<IonIcon icon={videocam} slot="start"></IonIcon>
<input id="file" hidden type="file" accept="video/*" onChange={e => onUploadVideo(e.target.files)} />
<label htmlFor="file">Selecionar arquivo*</label>
</IonButton> |
Any news? At least update the doc that mention "file" confusing the user. It should be removed.
|
@JEricaM, I agree. The fact that the docs reference |
I've tested on Angular and The docs are correct since it works on angular, if it's not supported on other frameworks maybe it should include a note about it. |
Hi everyone, I wanted to provide an update on this. There are a few issues noted here, so I will provide updates one by one.
The
As Julio mentioned in #814 (comment), he was able to set We recommend using the native
This was a mistake on our end and has been corrected in ionic-team/ionic-framework#25501. These changes should be available in the next release of Ionic.
This was a mistake on our end during the early days of Ionic v4 development. The property should not have been added. It has been deprecated in ionic-team/ionic-framework#25501 and will be removed in an upcoming major release of Ionic. These changes should be available in the next release of Ionic. As mentioned before, using the I understand this may not be the resolution some were looking for, but hopefully this provides clarification around our intended usage of |
Bug Report
Ionic version:
[x] 4.x
Current behavior:
The
ion-input
component makes multiple references in the documentation to provisions for whentype="file"
.The
type
parameter is bound to the interfaceTextFieldTypes
.The
TextFieldTypes
interface doesn't includefile
:This means that its impossible to set the input to a file and access the file-related features such as
multiple
oraccept
.Other information:
Based on a discussion on StackOverflow.
The text was updated successfully, but these errors were encountered: