cordova-plugin-camera icon indicating copy to clipboard operation
cordova-plugin-camera copied to clipboard

"Choose file" button not removed when file selector is canceled.

Open aidanas opened this issue 5 years ago • 0 comments

Bug Report

Problem

While running an app built for electron platform (same issue on browser platform too) using the plugin and choosing to select from file it adds "Choose File" button to the app. When pressed it opens a file selector allowing to select a file. If we press "Cancel" on the dialog then the dialog is closed but "Choose File" button remains within the DOM with no callbacks called. So the only way to remove it is to actually choose a file.

What is expected to happen?

  • Either one of the callbacks to be called so we can manually remove input element from the DOM.
  • Or input element removed from the DOM by the plugin.

What does actually happen?

  • input.cordova-camera-select element remains within the DOM.

Command or Code

navigator.camera.getPicture(val => console.log(val), err => console.error(err), { quality: 50, destinationType: 0, sourceType: 0, correctOrientation: true });

Environment, Platform, Device

  • Electron and Browser platforms

Version information

  • MacOS 10.15.5
  • Cordova 9
  • "cordova-plugin-camera": "^4.1.0"

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

aidanas avatar Jun 03 '20 08:06 aidanas