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

Android border rendering regression in 0.66 #32393

Closed
oblador opened this issue Oct 13, 2021 · 0 comments
Closed

Android border rendering regression in 0.66 #32393

oblador opened this issue Oct 13, 2021 · 0 comments
Labels
Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Needs: Triage 🔍 Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@oblador
Copy link
Contributor

oblador commented Oct 13, 2021

Description

Since 0.66 the rendering of borders on Android has moved from being completely inside the view, to be half outside, half inside. This is inconsistent with iOS, web/css and previous versions of react native. Potentially caused by #29099.

React Native version:

info Fetching system and libraries information... System: OS: macOS 11.6 CPU: (8) arm64 Apple M1 Memory: 241.44 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.10.0 - ~/.volta/tools/image/node/16.10.0/bin/node Yarn: 1.22.11 - ~/.volta/tools/image/yarn/1.22.11/bin/yarn npm: 7.24.0 - ~/.volta/tools/image/node/16.10.0/bin/npm Watchman: 2021.09.06.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0 Android SDK: Not Found IDEs: Android Studio: 4.2 AI-202.7660.26.42.7351085 Xcode: 13.0/13A233 - /usr/bin/xcodebuild Languages: Java: 11.0.10 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.66.0 => 0.66.0 react-native-macos: Not Found npmGlobalPackages: *react-native*: Not Found

Steps To Reproduce

  1. Add a borderWidth: 20 on a component.
  2. Observe that border now expands beyond the view itself.

Expected Results

Border is rendered completely inside the view bounds.

Snack, code example, screenshot, or link to a repository:

Screenshot 2021-10-13 at 14 58 54

This code produces different results on iOS (left) and Android (right)

import React from 'react';
import {View} from 'react-native';

const App = () => {
  return (
    <View style={{flex: 1, justifyContent: 'center', padding: 20}}>
      <View
        style={{
          aspectRatio: 1,
          backgroundColor: 'green',
          borderWidth: 8,
          borderColor: 'black',
          borderStyle: 'dashed',
        }}
      />
    </View>
  );
};
@react-native-bot react-native-bot added Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Platform: Android Android applications. labels Oct 13, 2021
facebook-github-bot pushed a commit that referenced this issue Oct 14, 2021
Summary:
#29099 introduced a regression where non-rounded borders on Android would render partly outside of the bounds of the view as I reported in #32393. This PR addresses that by rendering the borders completely inside the view like it works on iOS, previous version of RN and for rounded corners.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Fixed] - Fix Android border positioning regression

Pull Request resolved: #32398

Test Plan:
Rendering the following code (as reported in the issue) in the RN Tester app:

```jsx
<View
  style={{
    aspectRatio: 1,
    backgroundColor: 'green',
    borderWidth: 8,
    borderColor: 'black',
    borderStyle: 'dashed',
  }}
/>
```

|Before|After|
|--|--|
|![before](https://user-images.githubusercontent.com/378279/137178113-dd2fea7e-48c8-450b-be3a-92706ef93194.png)|![after](https://user-images.githubusercontent.com/378279/137178140-b5ce7b3d-d455-48a9-a57f-0f3194a65c9a.png)|

Reviewed By: yungsters

Differential Revision: D31623647

Pulled By: lunaleaps

fbshipit-source-id: c38d172ae4a9dc48f800c63258223a59e2f621ed
lunaleaps pushed a commit that referenced this issue Oct 15, 2021
Summary:
#29099 introduced a regression where non-rounded borders on Android would render partly outside of the bounds of the view as I reported in #32393. This PR addresses that by rendering the borders completely inside the view like it works on iOS, previous version of RN and for rounded corners.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Fixed] - Fix Android border positioning regression

Pull Request resolved: #32398

Test Plan:
Rendering the following code (as reported in the issue) in the RN Tester app:

```jsx
<View
  style={{
    aspectRatio: 1,
    backgroundColor: 'green',
    borderWidth: 8,
    borderColor: 'black',
    borderStyle: 'dashed',
  }}
/>
```

|Before|After|
|--|--|
|![before](https://user-images.githubusercontent.com/378279/137178113-dd2fea7e-48c8-450b-be3a-92706ef93194.png)|![after](https://user-images.githubusercontent.com/378279/137178140-b5ce7b3d-d455-48a9-a57f-0f3194a65c9a.png)|

Reviewed By: yungsters

Differential Revision: D31623647

Pulled By: lunaleaps

fbshipit-source-id: c38d172ae4a9dc48f800c63258223a59e2f621ed
@oblador oblador closed this as completed Oct 25, 2021
@facebook facebook locked as resolved and limited conversation to collaborators Oct 25, 2022
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Needs: Triage 🔍 Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

2 participants