Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-11782

Dangerous incompatibilities with browser platform

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • cordova-plugin-dialogs
    • None

    Description

      The browser platform, reflecting the limitations of window.confirm() and window.prompt(), doesn't allow customization of the button labels. That's fine.

      However, it blithely triggers the callback with hardcoded button values of 1 for OK and 2 for Cancel. That's dangerous, because the developer may have assigned different labels for those buttons.

      For example, if the developer reverses the order of the Cancel and OK buttons (and therefore interprets the button index differently in the callback), the browser platform version will end up calling the OK callback when the user presses Cancel, which could lead to data loss and other serious problems.

      One solution would be to document the limitations of the browser platform, and then fail fast (i.e. refuse to show the dialog) if the caller tries to pass custom button labels.

      Attachments

        Activity

          People

            Unassigned Unassigned
            marfire Kevin Christopher Henry
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: