From 9caf99162dcd1ee73c571c494ca3115540f45f69 Mon Sep 17 00:00:00 2001 From: Roshan Gautam Date: Sun, 29 Sep 2019 19:32:17 -0700 Subject: [PATCH] Fixes button partially showing when parent view height is 0 (#26435) Summary: When the parent view that wraps a button has height 0, the button is still shown partially because of the padding given for text inside Button component for iOS. Here is the issue raised for that: https://github.com/facebook/react-native/issues/26421 Probably, we should not hard code these values, rather provide a way to provide custom style ? This is my first PR so not making big change. :D ## Changelog [iOS] [Fixed] - Give margin instead of padding to text in Button component Pull Request resolved: https://github.com/facebook/react-native/pull/26435 Test Plan: When using this block of code, ``` ``` Before: image After: image Differential Revision: D17661181 Pulled By: cpojer fbshipit-source-id: 62b04123d9edb4d760bd54d96ae0615c1ccff7ab --- Libraries/Components/Button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Components/Button.js b/Libraries/Components/Button.js index 05a32f0b5bfb45..6a2b8244f27266 100644 --- a/Libraries/Components/Button.js +++ b/Libraries/Components/Button.js @@ -204,7 +204,7 @@ const styles = StyleSheet.create({ }), text: { textAlign: 'center', - padding: 8, + margin: 8, ...Platform.select({ ios: { // iOS blue from https://developer.apple.com/ios/human-interface-guidelines/visual-design/color/