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
{{ message }}
Repository navigation
Commit 45dd67d
Browse filesBrowse the repository at this point in the historyBrowse files
Keep Android disabled-state resets scoped to core views
## Summary:
#58799 fixed the original Pressable tap-target reset on `main`. This follow-up keeps that reset in `ReactViewManager`. Applying it in every manager can re-enable a non-editable `TextInput` when accessibility disabled is cleared, because `ReactTextInputManager` does not derive from `ReactViewManager` and controls its enabled state through `editable`.
`BaseViewManager` now has a protected instance hook, `resetDisabledFromAccessibilityState`, that does nothing by default. `ReactViewManager` overrides it to restore the enabled state that accessibility disabled took away, so its subclasses get the same behavior without a class check. `setViewState` clears the disabled tag itself, so view managers don't need to call super. Other managers keep the enabled state they control.
Since this PR was opened, #59387 started sending the full `accessibilityState` with Props 2.0 and #59047 re-enables views on recycle, so the earlier C++ prop change and the `ReactViewGroup` change are no longer part of this PR. The JavaScript components are unchanged.
## Changelog:
[ANDROID] [FIXED] - Preserve non-editable text inputs when accessibility disabled is cleared.
## Test plan:
With the Android SDK, JDK 21, and Yarn v1 on the environment path:
```sh
./gradlew :packages:react-native:ReactAndroid:testDebugUnitTest \
--tests com.facebook.react.uimanager.BaseViewManagerTest \
--tests com.facebook.react.views.textinput.ReactTextInputPropertyTest \
--tests com.facebook.react.views.view.ReactViewGroupTest \
-Preact.internal.useHermesStable=true --no-daemon --max-workers=2 \
-Dorg.gradle.jvmargs='-Xmx2g -XX:MaxMetaspaceSize=768m' --console=plain
```
All 82 tests pass. The non-editable `TextInput` test fails on `main` and passes with this change. A `ReactViewManager` subclass test checks that subclasses inherit the reset.
The `ReactAndroid.api` lines were checked against the compiled classes with `javap`. No full Android build, emulator, or device test was run.
Differential Revision: D133495913
Pull Request resolved: #58795
Copy file name to clipboardExpand all lines: packages/react-native/ReactAndroid/src/test/java/com/facebook/react/views/textinput/ReactTextInputPropertyTest.kt
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -266,6 +266,20 @@ class ReactTextInputPropertyTest {
0 commit comments