Keyboard accessibility follow up (#25274)

Summary:
This is a follow up PR to https://github.com/facebook/react-native/issues/24359. There's a good thread in the mentioned PR for more background for why I'm doing this change. Essentially `focusable` makes more sense since it is about whether a view can receive user-initiated focus from a pointer or keyboard.
Pull Request resolved: https://github.com/facebook/react-native/pull/25274

Differential Revision: D15873739

Pulled By: cpojer

fbshipit-source-id: 0f526bb99ecdc68131dfc10200a5d44c2ef75b33
This commit is contained in:
Sam Mathias Weggersen
2019-06-21 03:04:00 -07:00
committed by Facebook Github Bot
parent 1fb4b6caa0
commit 73c5a8ec1b
8 changed files with 17 additions and 16 deletions
@@ -226,9 +226,9 @@ public class ReactViewManager extends ViewGroupManager<ReactViewGroup> {
// handled in NativeViewHierarchyOptimizer
}
@ReactProp(name = "clickable")
public void setClickable(final ReactViewGroup view, boolean clickable) {
if (clickable) {
@ReactProp(name = "focusable")
public void setFocusable(final ReactViewGroup view, boolean focusable) {
if (focusable) {
view.setOnClickListener(
new View.OnClickListener() {
@Override
@@ -245,6 +245,7 @@ public class ReactViewManager extends ViewGroupManager<ReactViewGroup> {
else {
view.setOnClickListener(null);
view.setClickable(false);
// Don't set view.setFocusable(false) because we might still want it to be focusable for accessibiliy reasons
}
}