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
ngf-select directive is not working on iOS10 on the device #1728
Comments
Having the same issue, Angular 1.5.8, using a button elem. Setting type=file does nothing. Have not yet tested whether using a traditional input element would work. |
Does the demo page work? If yes it might be conflict with another library you have. |
I am having the exact same problem -- Ionic v1 and Angular 1.5.3. I haven't figured out why, but if I run my app using |
The problem is that iOS10 is not allowing the click() event on the file input. I have tried a simple file input and another button that calls the input's click event. It works in a browser, but does not work when running on the actual iOS10 device. So, this is not so much the code with ngf-select, but the fact that ngf-select no longer works because the click() event can no longer be called. If anyone comes up with a workaround, I would really appreciate it. This is killing my app. |
i'm developing a cordova app and the ios version have similar problem. The following markup works on desktop (linux window macos) and android:
However it does not work on ios using safari. haven't tested on ios-chrome yet, but this case isn't on my scope. After a few experiences, i got to this snippet. it seems to work on safari/ios 9.3.5 (on ipad):
Why the use of a input type="file" seems to help i have no idea. |
We are also seeing this issue, have the following code:
Running within ionic. Tested working fine using iOS10 on an iPhone 6 but select dialog will not open when running iOS10 on an iPhone 5. |
Update on the above, upgraded an iPhone 5c from iOS 9.3 to 10.1 and the ngf-select item has stopped working (was working prior to upgrade). |
+1 |
As a workaround I placed the input element on top of my button, so that the user will actually tap on the input element which triggers the image picker. |
As a workaround you can use |
@danialfarid if I'm using the drag and drop "dropbox" as featured in the demo, how do I implement this workaround without the file input floating in the middle of the drop box? |
I ran into this as well. I tried switching from button (which works on iPhone, android, and pc) to input[type=file], and now it crashes the app on iPad. Using this code:
UPDATE: This is my fault. I needed to set up some privacy values on the info.plist for accessing files and camera (see http://useyourloaf.com/blog/privacy-settings-in-ios-10/) |
Solution by M4v3R from here worked: https://forums.meteor.com/t/webkit-on-ios-ignores-trigger-click-on-file-input/29828 |
@henritoivar Could you please share your implementation of the workaround with us? I'm not implementing my own input type="file" field, I'm letting ng-file-upload do that for me using the Angular directives - so how do you "fix" it when the problem's in the directive itself? For example, my code that's note working: When I click that button, I'm able to select files in iOS as normal, they're just never uploading anything and since it's a mobile browser we can't really get any debug/console info to see what's going wrong. BTW the above works fine in all modern desktop browsers, just not in iOS browsers (Chrome, Safari). Haven't tested Android yet. |
@tpartee in order to debug mobile browsers you could make use of chrome for android phones (google for chrome://inspect) and safari have similar capabilities as well i debug my cordova apps that way. since it works on android i couldn't haste to call it a bug on the directive itself. |
Perhaps I mis-worded, I didn't mean to imply there's a bug in the directive - what I mean to say is that I do not use an input type="file" in my code, but that element must be created by the directive by necessity - therefore since it's in the directive, how am I supposed to employ the work-around mentioned above? The workaround assumes you have control over both the button and the input element. I only have a button element. If there is a input type="file" element it must be in the directive and therefore it's not clear to me how I can style it to appear over my button as mentioned in the above work-around. |
After deeper testing it seems the issue was in my Angular controller, not in ng-file-upload - my code posted above works fine if you are handling the promise properly and not being an idiot. See the examples for details, they helped me figure out where I went wrong. Tested working on iOS 10 in both Chrome and Safari, tested working in Chrome on current Android, tested working in FF, Chrome and Edge on Windows desktop. |
This is an IOS 10 bug/issue. I can see all of the code getting called but the fileElem[0].click(); is not actually working. I'm assuming this is security related. Any updates on this? |
Bump. This happens to me when using "Add to Home Screen" on iOS 10. Works fine on Safari proper.
|
I'd recommend checking out this issue that I filed a while ago, I encountered something similar related to file uploading. The key for me was conditionally applying the "multiple" attribute. |
For me this issue was caused by the FastClick polyfill. |
Duplicated on iPhone 6s Plus iOS 12.0 |
I have an existing app that had no problems using iOS9, but now that my phone has been updated to iOS10, the directive for ngf-select will not "trigger" the image picker. I have run through your code, and the directive does load correctly, and the click event does get called on fileElem[0], but nothing happens. Please note, the code does work correctly under the simulators (I am using an iMac). So, there is something new, in iOS10, just on the devices, that is keeping the click event from being properly processed so that the image file picker selections will display.
BTW, I am using the Ionic Framework v1.
The text was updated successfully, but these errors were encountered: