Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Button" inside a "View" with 0 height can be still partially seen #26421

Closed
Shuyifan opened this issue Sep 12, 2019 · 2 comments
Closed

"Button" inside a "View" with 0 height can be still partially seen #26421

Shuyifan opened this issue Sep 12, 2019 · 2 comments
Labels
Bug Component: Button Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@Shuyifan
Copy link

React Native version: 0.59

Steps To Reproduce

  1. Using an IOS device, or IOS simulator
  2. Using the following code
<View style={{height:0}}>
    <Button title="There is an issue"></Button>
</View>

Describe what you expected to happen:
For the snack provided, the expected result will be that nothing will show. Because the height of view is already set to be 0.

On Android device, it works as expecet. But on IOS device, the bottom sheet is still partily shown as follows:
Screen Shot 2019-09-12 at 2 28 24 PM

snack: https://snack.expo.io/ryVvONu8B

@Shuyifan Shuyifan added the Bug label Sep 12, 2019
facebook-github-bot pushed a commit that referenced this issue Sep 30, 2019
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:
#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: #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
@stale
Copy link

stale bot commented Dec 11, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 11, 2019
@stale
Copy link

stale bot commented Dec 21, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Dec 21, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Dec 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Component: Button Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

2 participants