You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by mo...@apache.org on 2019/05/21 03:12:56 UTC

[incubator-weex] branch master updated: [iOS] fix input text show error when has a attribute of maxlength

This is an automated email from the ASF dual-hosted git repository.

moshen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git


The following commit(s) were added to refs/heads/master by this push:
     new 499745a  [iOS] fix input text show error when has a attribute of maxlength
     new 2df301d  Merge pull request #2464 from jianhan-he/master
499745a is described below

commit 499745a71f561d80a32c01042172474dfa5fe5ec
Author: linghe.lh <li...@alibaba-inc.com>
AuthorDate: Tue May 21 11:09:01 2019 +0800

    [iOS] fix input text show error when has a attribute of maxlength
---
 ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm
index 8f24fa4..49135a1 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm
+++ b/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm
@@ -683,10 +683,6 @@ WX_EXPORT_METHOD(@selector(setTextFormatter:))
         }
 
     }
-    if (_inputEvent) {
-        // bind each other , the key must be attrs
-        [self fireEvent:@"input" params:@{@"value":[textField text]} domChanges:@{@"attrs":@{@"value":[textField text]}}];
-    }
     
     if (_maxLength) {
         NSString *toBeString = textField.text;
@@ -705,6 +701,11 @@ WX_EXPORT_METHOD(@selector(setTextFormatter:))
             }
         }
     }
+
+    if (_inputEvent) {
+        // bind each other , the key must be attrs
+        [self fireEvent:@"input" params:@{@"value":[textField text]} domChanges:@{@"attrs":@{@"value":[textField text]}}];
+    }
 }
 
 - (void)setViewMovedUp:(BOOL)movedUp