You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 📜 Description
Fixed a crash when `TalkBack` is enabled on Android and you use
`OverKeyboardView`.
## 💡 Motivation and Context
The problem comes from the fact that the system tries to traverse the
view hierarchy, but overlay views are not part of the main view
hierarchy.
`OverKeyboardHostView` **pretends** that the views you pass to it are
its own children. From the platform’s point of view those views **are
not really descendants** of `OverKeyboardHostView` — they live in a
completely different window created with `WindowManager.addView`.
When the Android accessibility framework walks the view-tree it calls
`addChildrenForAccessibility()`, iterates over `getChildAt(i)` and
finally calls:
```kt
offsetRectBetweenParentAndChild(parent, child);
```
That helper checks that child **is a true descendant** of parent, and if
it isn’t it throws the exception you see:
```kt
java.lang.IllegalArgumentException: parameter must be a descendant of this view
```
To solve this I decided to exclude `OverKeyboardHostView` from
accessibility traversal, so that inner views handles accessibility on
their own (this is how it should work).
Closes#961
## 📢 Changelog
<!-- High level overview of important changes -->
<!-- For example: fixed status bar manipulation; added new types
declarations; -->
<!-- If your changes don't affect one of platform/language below - then
remove this platform/language -->
### Android
- don't add `OverKeyboardView` container to an accessibility;
## 🤔 How Has This Been Tested?
Tested manually in Fabric example on Pixel 7 Pro API 35.
## 📸 Screenshots (if appropriate):
https://github.com/user-attachments/assets/8e2eff6a-d0cc-4d8d-9e6a-1a7a5a2d8a28
## 📝 Checklist
- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changed
0 commit comments