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

notification.prompt doesn't accept an empty string for default text

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.7.0, 2.8.0
    • 3.3.0
    • cordova-plugin-dialogs
    • None

    Description

      Specifying "" as the last parameter for navigator.notification.prompt, the prompt dialog will still show "Default Text" in the text input box. However, putting a string of just a single space works (but also results in a space in the text box).

      In additional seems like the default of "Default Text" isn't the best choice from UX perspective. A default of an empty text box would make more sense.

      Changing line 5909 in cordova.js from:

      var _defaultText = (defaultText || "Default text");
      to
      var _defaultText = (defaultText || "");

      Resolves the issue and gives a blank text box by default. Documentation would also need to be updated with the new default if this is adopted.

      Attachments

        Activity

          People

            mrbillau Michael Billau
            todd.miller Todd Miller
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: