cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas K. (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CB-3762) notification.prompt doesn't accept an empty string for default text
Date Tue, 02 Jul 2013 12:58:21 GMT

    [ https://issues.apache.org/jira/browse/CB-3762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13697744#comment-13697744
] 

Thomas K. edited comment on CB-3762 at 7/2/13 12:57 PM:
--------------------------------------------------------

The bug still exists in Android's cordova.js
The bug occurs because if("") is false in JavaScript, hence x = "" || "Default text" results
in x = "Default text"! 

https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=blob;f=framework/assets/www/cordova.js;h=873c068230e3706e13fb0b575ae3895521ba5acb;hb=df1536ea77e97b7d362a19582f8beddd168c5ec3#l6360
                
      was (Author: katzlbt):
    The bug still exists in Android's cordova.js
The bug occurs because if("") is false in JavaScript!

https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=blob;f=framework/assets/www/cordova.js;h=873c068230e3706e13fb0b575ae3895521ba5acb;hb=df1536ea77e97b7d362a19582f8beddd168c5ec3#l6360
                  
> notification.prompt doesn't accept an empty string for default text
> -------------------------------------------------------------------
>
>                 Key: CB-3762
>                 URL: https://issues.apache.org/jira/browse/CB-3762
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Dialogs
>    Affects Versions: 2.7.0, 2.8.0
>            Reporter: Todd Miller
>            Assignee: Steve Gill
>            Priority: Minor
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message