mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook Github Bot
parent
1fb4b6caa0
commit
73c5a8ec1b
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user