[
https://issues.apache.org/jira/browse/FLEX-25939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Justin Mclean resolved FLEX-25939.
----------------------------------
Resolution: Fixed
Fix Version/s: Apache Flex 4.10.0
Fixed in develop branch.
Code to test:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<s:layout>
<s:VerticalLayout />
</s:layout>
<fx:Script>
<![CDATA[
[Bindable] public var stepper:Number = 100
protected function click(event:MouseEvent):void
{
stepper = Number.NaN;
}
]]>
</fx:Script>
<s:NumericStepper value="{stepper}" minimum="0" maximum="200" />
<s:Button label="Click Me" click="click(event)" />
</s:Application>
> NumericStepper fails to commit when value is set to NaN
> -------------------------------------------------------
>
> Key: FLEX-25939
> URL: https://issues.apache.org/jira/browse/FLEX-25939
> Project: Apache Flex
> Issue Type: Bug
> Components: Spark: NumericStepper
> Affects Versions: Adobe Flex SDK 4.1 (Release)
> Environment: Affected OS(s): All OS Platforms
> Affected OS(s): All OS Platforms
> Browser: Firefox 3.x
> Language Found: English
> Reporter: Adobe JIRA
> Labels: easyfix, easytest
> Fix For: Apache Flex 4.10.0
>
>
> Steps to reproduce:
> 1.Create a NumericStepper whose value field is bound to a property of an
> object
> 2.Set that object property to NaN
> 3.Make a change to the input of the stepper such that the input string is 3
> chars long and evaluate the value property
>
> Actual Results: If the change was made by directly editing the text, the
> text will have changed but value will remain NaN. Attempting to use the
> stepper buttons will have no effect.
>
>
> Expected Results: The value should update to the text input once the change
> is committed
>
>
> Workaround (if any): The bug is being caused by a logic error on line 749 of
> NumericStepper.as. In most cases, even if value is NaN, the if statement
> would still evaluate to true since the length of the input string would not
> be equal to the length of value. Since NaN is 3 characters long however, any
> input with a length of 3 will cause the if statement to evaluate to false and
> prevent value from being updated.
> The simplest workaround is to make sure that the object property value is
> bound to is never NaN, however this may not always be possible in which case
> you would have to extend NumericStepper and override the commitProperties()
> function with a version that checks if value is NaN.
--
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