Skip to content

Commit

Permalink
Provide stub for View's accessible prop (#558)
Browse files Browse the repository at this point in the history
Because we didn't have any implementation for View's accessible prop, some
views were considered to be layout-only which weren't layout-only on iOS
and Android. The specific scenario I'm trying to fix is around touchables
(e.g. TouchableWithoutFeedback). I ran into a case where a touchable was
layout-only on Windows. When tapping it, React Native's JS code attempted
to measure the view. React Native was unable to return a result for the
measure request because the view that was being measured was layout-only.

React Native's JS sets accessible to true on touchables. According to the
React Native docs, "by default, all touchable elements are accessible."
(http://facebook.github.io/react-native/releases/0.30/docs/accessibility.html#accessible-ios-android)

By providing a stub implementation for the accessible prop, touchables
should never be layout-only on Windows thus fixing the measuring issue.

I opened issue #557 to track providing a proper implementation for the
accessible prop.
  • Loading branch information
rigdern authored and rozele committed Aug 7, 2016
1 parent 2051d67 commit 3de3cc3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ReactWindows/ReactNative/Views/View/ReactViewManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ public override string Name
}
}

/// <summary>
/// Sets whether or not the view is an accessibility element.
/// </summary>
/// <param name="view">The view.</param>
/// <param name="accessible">A flag indicating whether or not the view is an accessibility element.</param>
[ReactProp("accessible")]
public void SetAccessible(Border view, bool accessible)
{
// TODO: #557 Provide implementation for View's accessible prop

// We need to have this stub for this prop so that Views which
// specify the accessible prop aren't considered to be layout-only.
// The proper implementation is still to be determined.
}

/// <summary>
/// Set the pointer events handling mode for the view.
/// </summary>
Expand Down

0 comments on commit 3de3cc3

Please sign in to comment.