Skip to content

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

@aidanas

Description

@aidanas

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

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions