Skip to content

Commit

Permalink
fix: read accessibilityLabel from parent's view to avoid performance …
Browse files Browse the repository at this point in the history
…hit on RN (#259)

* fix: read accessibilityLabel from parent's view to avoid performance hit on RN

* fix
  • Loading branch information
marandaneto authored Nov 20, 2024
1 parent b999bac commit 4c548af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Next

- fix: read accessibilityLabel from parent's view to avoid performance hit on RN ([#259](https://github.com/PostHog/posthog-ios/pull/259))

## 3.15.5 - 2024-11-19

- fix: properly mask SwiftUI Text (and text-based views) ([#257](https://github.com/PostHog/posthog-ios/pull/257))
Expand Down
4 changes: 3 additions & 1 deletion PostHog/Replay/UIView+Util.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
if let identifier = accessibilityIdentifier {
isNoCapture = checkLabel(identifier)
}
if let label = accessibilityLabel, !isNoCapture {
// read accessibilityLabel from the parent's view to skip the RCTRecursiveAccessibilityLabel on RN which is slow and may cause an endless loop
// see https://github.com/facebook/react-native/issues/33084
if let label = super.accessibilityLabel, !isNoCapture {
isNoCapture = checkLabel(label)
}

Expand Down

0 comments on commit 4c548af

Please sign in to comment.