mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 01:40:08 +00:00
Add disabled to accessibilityTraits in case button is disabled
Reviewed By: javache Differential Revision: D4593622 fbshipit-source-id: 211f90f6af531a577af4e5487b43a3870f725bff
This commit is contained in:
parent
fd4ad6ca82
commit
813f873320
@ -111,11 +111,15 @@ class Button extends React.Component {
|
||||
'The title prop of a Button must be a string',
|
||||
);
|
||||
const formattedTitle = Platform.OS === 'android' ? title.toUpperCase() : title;
|
||||
const accessibilityTraits = ['button'];
|
||||
if (disabled) {
|
||||
accessibilityTraits.push('disabled');
|
||||
}
|
||||
return (
|
||||
<Touchable
|
||||
accessibilityComponentType="button"
|
||||
accessibilityLabel={accessibilityLabel}
|
||||
accessibilityTraits={['button']}
|
||||
accessibilityTraits={accessibilityTraits}
|
||||
testID={testID}
|
||||
disabled={disabled}
|
||||
onPress={onPress}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user