You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "David Coleman (JIRA)" <ji...@apache.org> on 2013/01/22 13:38:12 UTC

[jira] [Comment Edited] (FLEX-28947) Clear NumericStepper Value and get NaN in the display text area

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

David Coleman edited comment on FLEX-28947 at 1/22/13 12:36 PM:
----------------------------------------------------------------

I've been reading this ticket here: https://issues.apache.org/jira/browse/FLEX-33064 ...  it seems that there is some debate as to the behavior of the NaN value in this component.  In the case of this issue, what should be the proper value when the user deletes all content in the TextInput?  For me, it should be 0 or minimum.  That is what common UX practice would instruct me to do, since the end user (non-programmer's) expectation is going to be that delete all content will return to "default", which in this case one would assume to be 0 || minimum.

I see that in John Fletcher's comment on the other issue (https://issues.apache.org/jira/browse/FLEX-33064?focusedCommentId=13395927&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13395927) he mentions that there may be code that depends on the NaN option, so I have the following proposal:

I think that maybe a useful fix to this would be to add a "defaultValue" to this component.  and if there is code that depends on NaN we don't define defaultValue and default is NaN (as now).  Then if you define defaultValue="###" the logic will replace any textDisplay.text=="" with defaultValue or minimum or maximum if defaultValue is out of range.

Anyone want to opine?
                
      was (Author: david_coleman):
    I've been reading this ticket here: https://issues.apache.org/jira/browse/FLEX-33064 ...  it seems that there is some debate as to the behavior of the NaN value in this component.  In the case of this issue, what should be the proper value when the user deletes all content in the TextInput.  For me, it should be 0 or minimum.  That is what common UX practice would instruct me to do, since the end user (non-programmer's) expectation is going to be that delete all content will return to "default", which in this case one would assume to be 0 || minimum.

I see that in John Fletcher's comment on the other issue (https://issues.apache.org/jira/browse/FLEX-33064?focusedCommentId=13395927&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13395927) he mentions that there may be code that depends on the NaN option, so I have the following proposal:

I think that maybe a useful fix to this would be to add a "defaultValue" to this component.  and if there is code that depends on NaN we don't define defaultValue and default is NaN (as now).  Then if you define defaultValue="###" the logic will replace any textDisplay.text=="" with defaultValue or minimum or maximum if defaultValue is out of range.

Anyone want to opine?
                  
> Clear NumericStepper Value and get NaN in the display text area
> ---------------------------------------------------------------
>
>                 Key: FLEX-28947
>                 URL: https://issues.apache.org/jira/browse/FLEX-28947
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: NumericStepper
>    Affects Versions: Adobe Flex SDK 4.5 (Release)
>         Environment: Affected OS(s): Windows
> Affected OS(s): 
> Browser: Other (specify version)
> Language Found: English
>            Reporter: Adobe JIRA
>              Labels: EasyFix
>         Attachments: Flex29847.air
>
>
> Steps to reproduce:
> 1. Create Spark NumericStepper
> 2. Create Spark Button
> 3. Backspace the value in NumericStepper
> 4. Click Button
>  
>  Actual Results:
>  NaN is displayed in the NumericStepper
>  
>  Expected Results:
> Value remains empty or the default value is set.
>  
>  
>  Workaround (if any):
> Set the callback valueParseFunction to the following function:
> 			private function _numericStepperParse(value:String):Number
> 			{
> 				if (!value) {
> 					return 0 
> 				}
> 				
> 				return Number(value);
> 			}

--
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