-
Notifications
You must be signed in to change notification settings - Fork 15
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
Cannot use file input to capture image #88
Comments
I was able to replicate your problem, and I updated the file input field to the following: <input accept="image/*" capture="environment" type="file" > Try adding capture="environment" and you should get a dialog like so. Let me know if that works and here is some handy info about media capture that I was able to find. |
Out of curiosity, are you doing this on hardware? In the emulator it is working right. I've tried the following
|
Does adding a AndroidManifest.xml <activity
android:name=".MainActivity"
android:exported="true">
+ android:launchMode="singleTask"
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity> This will ensure that a single instance of |
Yup, I've tried that too. Are you seeing the same issue if you run the test project on hardware? |
I'm using
<input type="file" accepts="image/*" capture />
which works perfectly on web and iOS, and for the photo gallery on Android, but for camera captures on Android it looks like Hotwire is restarting my MainActivity and I'm loosing state, almost like the page is reloading. Additionally, this works fine on an emulator, just not on device.For debugging purposes I've tried this on a new project, just adding camera and file writing permissions to the manifest with the same results.
Any suggestions?
Edit: Added a minimal sample repo that demonstrates the issue: https://github.com/jbennett/hotwire-native-file-input
The text was updated successfully, but these errors were encountered: