Skip to content

Commit

Permalink
adding togglebutton to attributedstring conversions (#35632)
Browse files Browse the repository at this point in the history
Summary:
fixes runtime error `E/ReactNativeJNI(24576): Unsupported AccessibilityRole value: togglebutton` when using togglebutton accessibilityRole with Text. Related fabOnReact@da899c0

## Changelog

[GENERAL] [FIXED] - Fixes crash when using togglebutton accessibilityRole with Text

Pull Request resolved: #35632

Reviewed By: lunaleaps

Differential Revision: D42360628

Pulled By: rshest

fbshipit-source-id: afca8f540d972e1df0c390b3dff8875f07804e97
  • Loading branch information
fabOnReact authored and facebook-github-bot committed Jan 5, 2023
1 parent 4c911a2 commit dcc5dbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ReactCommon/react/renderer/attributedstring/conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ inline void fromRawValue(
auto string = (std::string)value;
if (string == "none") {
result = AccessibilityRole::None;
} else if (string == "button") {
} else if (string == "button" || string == "togglebutton") {
result = AccessibilityRole::Button;
} else if (string == "link") {
result = AccessibilityRole::Link;
Expand Down

0 comments on commit dcc5dbe

Please sign in to comment.