apache / apache/cordova-android

File input doesn't select a file when using a sidebar app

Open
#1,024 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.8k
Forks
1.6k
Avg merge
16h 18m
Merged PRs (30d)
11

Description

# Bug Report

## Problem
When selecting an app from the sidebar when opening a file the file is not sent back to the app.

### What is expected to happen?
When I select a file using an app from the sidebar the file should be selected.

### What does actually happen?
The file is selected in the other app and returns to the file picker screen and does not return to the app

## Information
Steps to reproduce:
1. Create a `` element
2. Click that element to open the android file picker
3. Click the hamburger at the top to open the sidebar
4. Click on an app from the sidebar menu, the most easy use case is the file manager
5. Select a file inside the file manager app
6. The file should be sent to the cordova app but instead it only returns back to the screen with the sidebar.

Using the same sequence in the browser allows the site to get the selected file. So the browser implementation is the expected behavior.

### Command or Code
I don't think anything besides an ``

### Environment, Platform, Device
Android, I've tested it both in samsung 8 and xiomi redmi 3, but I think most devices is affected by this.

### Version information
Cordova 9.0.0
I've tried to upgrade to cordova-android 9.0 to solve this, but the issue still exists. I've verified it also in cordova-android 8.1

## Checklist

- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above

I would love to help out solving this, but I couldn't find where the relevant code is.

Contributor guide

Open the contributing guide

Research direction

No source file, entry point, or test is named. Start by reproducing the Android file-picker flow with an input type="file" and compare it with the browser behavior; trace the sidebar app return path. Done means the selected file is delivered back to the Cordova app and the change is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
android
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.