Fix the accessibilityRole crash by updating values in the enum

Summary:
Changelog:
[Internal][Fixed] - Fix the accessibilityRole crash

I only assigned three values that would be used for embedded links inside text (button, link, image). But the accessibilityRole has a lot of values that may be applied in other places. (https://reactnative.dev/docs/accessibility) To avoid this crash, need to add all possible values to the enum.

Reviewed By: JoshuaGross, shergin

Differential Revision: D22549264

fbshipit-source-id: dbaacf1965624e1d2eabe193b46168c6c8740f46
This commit is contained in:
Jiayan Zhuang
2020-07-15 16:45:25 -07:00
committed by Facebook GitHub Bot
parent a7818dd754
commit db365b86b2
5 changed files with 296 additions and 5 deletions
@@ -94,7 +94,7 @@ void TextAttributes::apply(TextAttributes textAttributes) {
layoutDirection = textAttributes.layoutDirection.hasValue()
? textAttributes.layoutDirection
: layoutDirection;
accessibilityRole = !textAttributes.accessibilityRole.empty()
accessibilityRole = textAttributes.accessibilityRole.hasValue()
? textAttributes.accessibilityRole
: accessibilityRole;
}