You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2018/04/03 13:21:26 UTC

incubator-weex git commit: [WEEX-277][iOS]fixed textfield menuController delete case crash fixed textfield menuController delete case crash

Repository: incubator-weex
Updated Branches:
  refs/heads/master ca6104f34 -> c7a2db2a8


[WEEX-277][iOS]fixed textfield menuController delete case crash
fixed textfield menuController delete case crash

fixed menu item show by system default

close #1096


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

Branch: refs/heads/master
Commit: c7a2db2a86b1329a14a01aa87bec53af93ec8314
Parents: ca6104f
Author: zhutong <zh...@guoxiaomei.com>
Authored: Mon Apr 2 11:58:24 2018 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Tue Apr 3 21:17:09 2018 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Component/WXTextInputComponent.m | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c7a2db2a/ios/sdk/WeexSDK/Sources/Component/WXTextInputComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextInputComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXTextInputComponent.m
index 595be8b..02d8f52 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXTextInputComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXTextInputComponent.m
@@ -50,7 +50,13 @@
 - (BOOL)canPerformAction:(SEL)action withSender:(id)sender
 {
     // this behavior will hide the action like copy, cut, paste, selectAll and so on.
-    return [[self.wx_component valueForKey:@"allowCopyPaste"] boolValue];
+    // fixed textfield issue
+    // fixed menu item show by system default(like: if word not be selected ,menu item not show "cut")
+    BOOL allowCopyPaste = [[self.wx_component valueForKey:@"allowCopyPaste"] boolValue];
+    if (allowCopyPaste) {
+        return [super canPerformAction:action withSender:sender];
+    }
+    return NO;
 }
 
 - (CGRect)editingRectForBounds:(CGRect)bounds