Fix inability to remove 'Disabled' state from AccessibilityStates

Summary:
D8842691 split AccessibilityTraits into multiple RN properties.  However, the accessor code did not support REMOVING traits.
This results in buttons that were disabled (AccessibilityTraits & NotEnabled === true) never being enabled.

Fix the issue by making the split accessors properly mask in the bits, allowing you unset them without disturbing bits managed by the other accessor.

NOTE: setting AccessibilityTraits and AccessibilityRole or AccessibilityStates will still result in bugs.

Reviewed By: shergin

Differential Revision: D9661970

fbshipit-source-id: 77d70dd0754f2eaf8cbf895bfc13757c697a76d8
This commit is contained in:
Zack Gomez
2018-11-26 16:34:14 +00:00
committed by Lorenzo Sciandra
parent 26b5a6e002
commit 79b33118ea
2 changed files with 14 additions and 2 deletions
@@ -84,6 +84,7 @@ module.exports = {
'radiobutton_checked',
'radiobutton_unchecked',
],
// This must be kept in sync with the AccessibilityRolesMask in RCTViewManager.m
AccessibilityRoles: [
'none',
'button',
@@ -97,5 +98,6 @@ module.exports = {
'header',
'summary',
],
// This must be kept in sync with the AccessibilityStatesMask in RCTViewManager.m
AccessibilityStates: ['selected', 'disabled'],
};