From 813f873320e51f62f7079c5d6da3e6c755964d1f Mon Sep 17 00:00:00 2001 From: Archit Pal Singh Sachdeva Date: Wed, 22 Feb 2017 13:10:55 -0800 Subject: [PATCH] Add disabled to accessibilityTraits in case button is disabled Reviewed By: javache Differential Revision: D4593622 fbshipit-source-id: 211f90f6af531a577af4e5487b43a3870f725bff --- Libraries/Components/Button.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Libraries/Components/Button.js b/Libraries/Components/Button.js index d8626a3ed..8c0fd5042 100644 --- a/Libraries/Components/Button.js +++ b/Libraries/Components/Button.js @@ -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 (