Skip to content

Commit 9caf991

Browse files
roshangm1facebook-github-bot
authored andcommitted
Fixes button partially showing when parent view height is 0 (facebook#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: facebook#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: facebook#26435 Test Plan: When using this block of code, ``` <View style={{height:0}}> <Button title="There is an issue"></Button> </View> ``` Before: <img width="284" alt="image" src="https://user-images.githubusercontent.com/5866078/64905271-6c129700-d6f5-11e9-86c1-c301eb8123f3.png"> After: <img width="283" alt="image" src="https://user-images.githubusercontent.com/5866078/64905284-8cdaec80-d6f5-11e9-9589-28d8d01c8ba1.png"> Differential Revision: D17661181 Pulled By: cpojer fbshipit-source-id: 62b04123d9edb4d760bd54d96ae0615c1ccff7ab
1 parent 4b93500 commit 9caf991

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Libraries/Components/Button.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ const styles = StyleSheet.create({
204204
}),
205205
text: {
206206
textAlign: 'center',
207-
padding: 8,
207+
margin: 8,
208208
...Platform.select({
209209
ios: {
210210
// iOS blue from https://developer.apple.com/ios/human-interface-guidelines/visual-design/color/

0 commit comments

Comments
 (0)