Skip to content

onLayout height does not capture border #23994

Closed
@CyberMew

Description

@CyberMew

🐛 Bug Report

onLayout is providing incorrect values, resulting in my animated height value to be inaccurate.
Screenshot 2019-03-18 at 4 08 36 PM
^ Screenshot had a +10 bottom padding, if I remove it, the last line of text is cut in half for sure.

To Reproduce

Please look at code example. Download it and run it on iOS simulator. The react/native version does not matter.

Look at where the red box bottom is at, in relation to the bottom text. Now click on the bold title to close the panel and click on it to open it again.

Observe the screw up.

Observe the code in ./components/Panel.js especially setMaxHeight and setMinHeight which are the onLayout functions.

Expected Behavior

Screenshot 2019-03-18 at 4 08 31 PM

^ I expect to see this and not a shorten/cut off text.

Code Example

https://github.com/CyberMew/rnbug

Environment

React Native Environment Info:
System:
OS: macOS 10.14.3
CPU: (12) x64 Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz
Memory: 9.64 GB / 32.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.1 - /usr/local/bin/node
npm: 6.4.1 - /usr/local/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
IDEs:
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.1 => 0.59.1
npmGlobalPackages:
react-native-cli: 2.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions