You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2013/05/21 20:25:09 UTC
[02/12] git commit: [flex-sdk] [refs/heads/develop] - Revert fix for
FLEX-33505. It caused binding side-effects as it sent CHANGE events as you
typed in a number because the string can temporarily be not a number like
just having a - sign
Revert fix for FLEX-33505. It caused binding side-effects as it sent CHANGE events as you typed in a number because the string can temporarily be not a number like just having a - sign
Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/4fe27450
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/4fe27450
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/4fe27450
Branch: refs/heads/develop
Commit: 4fe274505d650164a60a58b26a41b9a8f480f1e1
Parents: 06fe5af
Author: Alex Harui <ah...@apache.org>
Authored: Wed May 15 23:59:40 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue May 21 11:24:37 2013 -0700
----------------------------------------------------------------------
.../projects/mx/src/mx/controls/NumericStepper.as | 9 +++-
.../spark/src/spark/components/NumericStepper.as | 37 ++++----------
2 files changed, 18 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/4fe27450/frameworks/projects/mx/src/mx/controls/NumericStepper.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/mx/src/mx/controls/NumericStepper.as b/frameworks/projects/mx/src/mx/controls/NumericStepper.as
index dd82b1b..3c188d3 100644
--- a/frameworks/projects/mx/src/mx/controls/NumericStepper.as
+++ b/frameworks/projects/mx/src/mx/controls/NumericStepper.as
@@ -1690,8 +1690,13 @@ public class NumericStepper extends UIComponent
// Stop the event from bubbling up.
event.stopImmediatePropagation();
- // fixes FLEX-33505
- takeValueFromTextField(event);
+ var inputValue:Number = Number(inputField.text);
+ if ((inputValue != value &&
+ (Math.abs(inputValue - value) >= 0.000001 || isNaN(inputValue))) ||
+ inputField.text == "")
+ {
+ _value = checkValidValue(inputValue);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/4fe27450/frameworks/projects/spark/src/spark/components/NumericStepper.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/NumericStepper.as b/frameworks/projects/spark/src/spark/components/NumericStepper.as
index 557d58a..6a45b32 100644
--- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
+++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
@@ -681,13 +681,9 @@ public class NumericStepper extends Spinner
if (instance == textDisplay)
{
- // fixes FLEX-33505
- textDisplay.addEventListener(Event.CHANGE,
- textDisplay_changeHandler);
-
textDisplay.addEventListener(FlexEvent.ENTER,
textDisplay_enterHandler);
- textDisplay.addEventListener(FocusEvent.FOCUS_OUT,
+ textDisplay.addEventListener(FocusEvent.FOCUS_OUT,
textDisplay_focusOutHandler);
textDisplay.focusEnabled = false;
textDisplay.maxChars = _maxChars;
@@ -897,27 +893,16 @@ public class NumericStepper extends Spinner
}
- /**
- * @private
- * When text is typed in, NumericStepper commits the
- * text currently displayed.
- */
- // fixes FLEX-33505
- private function textDisplay_changeHandler(event:Event):void
- {
- commitTextInput(true);
- }
-
- /**
- * @private
- * When the enter key is pressed, NumericStepper commits the
- * text currently displayed.
- */
- private function textDisplay_enterHandler(event:Event):void
- {
- commitTextInput(true);
- }
-
+ /**
+ * @private
+ * When the enter key is pressed, NumericStepper commits the
+ * text currently displayed.
+ */
+ private function textDisplay_enterHandler(event:Event):void
+ {
+ commitTextInput(true);
+ }
+
/**
* @private
* When the enter key is pressed, NumericStepper commits the