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 2017/05/25 08:10:37 UTC

[3/9] incubator-weex git commit: * [ios] try to fix crash about accessibility

* [ios] try to fix crash about accessibility


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

Branch: refs/heads/0.13-dev
Commit: 4e2e2040acaac50a40ba60fb21c9edbd36152f6d
Parents: b2f7901
Author: acton393 <zh...@gmail.com>
Authored: Thu May 25 14:40:46 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Thu May 25 14:40:46 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Model/WXComponent.m | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/4e2e2040/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent.m b/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
index 8ee5393..6971e69 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent.m
@@ -500,26 +500,26 @@
 - (void)_configWXComponentA11yWithAttributes:(NSDictionary *)attributes
 {
     WX_CHECK_COMPONENT_TYPE(self.componentType)
-    
-    if (!attributes) {
+    NSMutableDictionary *attributesCpy = [attributes mutableCopy];
+    if (!attributesCpy) {
         return;
     }
     
-    if (attributes[@"role"]){
+    if (attributesCpy[@"role"]){
         _role = [WXConvert WXUIAccessibilityTraits:attributes[@"role"]];
         self.view.accessibilityTraits = _role;
     }
-    if (attributes[@"ariaHidden"]) {
-        _ariaHidden = [WXConvert BOOL:attributes[@"ariaHidden"]];
+    if (attributesCpy[@"ariaHidden"]) {
+        _ariaHidden = [WXConvert BOOL:attributesCpy[@"ariaHidden"]];
         self.view.accessibilityElementsHidden = _ariaHidden;
     }
-    if (attributes[@"ariaLabel"]) {
-        _ariaLabel = [WXConvert NSString:attributes[@"ariaLabel"]];
+    if (attributesCpy[@"ariaLabel"]) {
+        _ariaLabel = [WXConvert NSString:attributesCpy[@"ariaLabel"]];
         self.view.accessibilityValue = _ariaLabel;
     }
     
-    if (attributes[@"testId"]) {
-        [self.view setAccessibilityIdentifier:[WXConvert NSString:attributes[@"testId"]]];
+    if (attributesCpy[@"testId"]) {
+        [self.view setAccessibilityIdentifier:[WXConvert NSString:attributesCpy[@"testId"]]];
     }
     
     // set accessibilityFrame for view which has no subview