flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlosrov...@apache.org
Subject git commit: [flex-sdk] [refs/heads/develop] - FLEX-34053 - MaskedTextInput - fixed a case when text is *not* complete and user makes a selection (1 or + characters) and then inserts a character. Now this case is supported.
Date Fri, 07 Feb 2014 11:32:02 GMT
Updated Branches:
  refs/heads/develop dcf12f943 -> 8658cf695


FLEX-34053 - MaskedTextInput - fixed a case when text is *not* complete and user makes a selection
(1 or + characters) and then inserts a character. Now this case is supported.


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/8658cf69
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/8658cf69
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/8658cf69

Branch: refs/heads/develop
Commit: 8658cf6957f96eae70214cd082c23a36476478de
Parents: dcf12f9
Author: Carlos Rovira <carlosrovira@apache.org>
Authored: Fri Feb 7 12:31:45 2014 +0100
Committer: Carlos Rovira <carlosrovira@apache.org>
Committed: Fri Feb 7 12:31:45 2014 +0100

----------------------------------------------------------------------
 .../experimental/src/spark/components/MaskedTextInput.as  | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/8658cf69/frameworks/projects/experimental/src/spark/components/MaskedTextInput.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental/src/spark/components/MaskedTextInput.as b/frameworks/projects/experimental/src/spark/components/MaskedTextInput.as
index 3058c18..be738ef 100644
--- a/frameworks/projects/experimental/src/spark/components/MaskedTextInput.as
+++ b/frameworks/projects/experimental/src/spark/components/MaskedTextInput.as
@@ -25,6 +25,7 @@ package spark.components {
     import flashx.textLayout.operations.CopyOperation;
     import flashx.textLayout.operations.DeleteTextOperation;
     import flashx.textLayout.operations.InsertTextOperation;
+    import flashx.textLayout.tlf_internal;
 
     import mx.core.mx_internal;
     import mx.utils.StringUtil;
@@ -34,6 +35,7 @@ package spark.components {
     import spark.events.TextOperationEvent;
 
     use namespace mx_internal;
+    use namespace tlf_internal;
 
     /**
      * Masked Text Input Component
@@ -373,12 +375,12 @@ package spark.components {
             //insert
             else if (event.operation is InsertTextOperation) {
                 var insertOp:InsertTextOperation = event.operation as InsertTextOperation;
-                if (insertOp.deleteSelectionState != null) {
+                if (insertOp.deleteSelectionState != null && !insertOp.deleteSelectionState.tlf_internal::selectionManagerOperationState)
{
                     //OVERRIDING INSERT
-                    if (ac < maxChars && isSeparator(ac)) {
-                        outputText = super.text.substring(0, insertOp.originalSelectionState.anchorPosition
+ 1) + (event.operation as InsertTextOperation).text + super.text.substring(insertOp.originalSelectionState.activePosition
+ 2);
+                    if (isSeparator(ac)) {
+                        outputText = super.text.substring(0, insertOp.originalSelectionState.anchorPosition
+ 1) + insertOp.text + super.text.substring(insertOp.originalSelectionState.activePosition
+ 2);
                     } else {
-                        outputText = super.text.substring(0, insertOp.originalSelectionState.anchorPosition)
+ (event.operation as InsertTextOperation).text + super.text.substring(insertOp.originalSelectionState.activePosition);
+                        outputText = super.text.substring(0, insertOp.originalSelectionState.anchorPosition)
+ insertOp.text + super.text.substring(insertOp.originalSelectionState.activePosition);
                     }
 
                     outputText = formatTextWithMask(cleanText(outputText));


Mime
View raw message