weex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acton...@apache.org
Subject [3/4] incubator-weex git commit: + [ios] fixbug placeholder show again
Date Thu, 03 Aug 2017 08:05:18 GMT
+ [ios] fixbug placeholder show again


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/befbfd36
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/befbfd36
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/befbfd36

Branch: refs/heads/0.16-dev
Commit: befbfd366be0a7e4c48e9d13708b2ff1a4aaf52b
Parents: fe422b6
Author: 齐山 <sunjjbobo@163.com>
Authored: Wed Aug 2 18:15:01 2017 +0800
Committer: 齐山 <sunjjbobo@163.com>
Committed: Wed Aug 2 18:15:01 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Component/WXEditComponent.m | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/befbfd36/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.m
index c9a4cee..c9d1202 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.m
@@ -361,10 +361,6 @@ WX_EXPORT_METHOD(@selector(getSelectionRange:))
     if (attributes[@"maxlength"]) {
         _maxLength = [NSNumber numberWithInteger:[attributes[@"maxlength"] integerValue]];
     }
-    if (attributes[@"placeholder"]) {
-        _placeholderString = [WXConvert NSString:attributes[@"placeholder"]]?:@"";
-        [self setPlaceholderAttributedString];
-    }
     if (attributes[@"value"]) {
         _value = [WXConvert NSString:attributes[@"value"]]?:@"";
         if (_maxLength && [_value length] > [_maxLength integerValue]&&
[_maxLength integerValue] >= 0) {
@@ -372,6 +368,13 @@ WX_EXPORT_METHOD(@selector(getSelectionRange:))
         }
         [self setText:_value];
     }
+    if (attributes[@"placeholder"]) {
+        _placeholderString = [WXConvert NSString:attributes[@"placeholder"]]?:@"";
+        if(_value.length > 0){
+            _placeholderString = @"";
+        }
+        [self setPlaceholderAttributedString];
+    }
     if (attributes[@"returnKeyType"]) {
         _returnKeyType = [WXConvert UIReturnKeyType:attributes[@"returnKeyType"]];
         [self setReturnKeyType:_returnKeyType];


Mime
View raw message