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

Artifacts on View with borderRadius on only 2 corners on iOS #11897

Closed
DenJohX opened this issue Jan 14, 2017 · 43 comments
Closed

Artifacts on View with borderRadius on only 2 corners on iOS #11897

DenJohX opened this issue Jan 14, 2017 · 43 comments
Labels
Help Wanted :octocat: Issues ideal for external contributors. Platform: iOS iOS applications. Ran Commands One of our bots successfully processed a command. Resolution: Fixed A PR that fixes this issue has been merged. Resolution: Locked This issue was locked by the bot. Resolution: PR Submitted A pull request with a fix has been provided.

Comments

@DenJohX
Copy link

DenJohX commented Jan 14, 2017

Description

I need a couple of Views with border radius only on the top or bottom corners, to use as container for TextInputs (its a email/password form).

Reproduction

Using this code:

    // style
    inputExample: {
        borderColor: '#9b9b9b',
        backgroundColor: 'white',
        borderWidth: 1,
        borderStyle: 'solid',
        height: 50,
    },
    inputTop: {
        borderTopLeftRadius: 6,
        borderTopRightRadius: 6,
        borderBottomLeftRadius: 0,
        borderBottomRightRadius: 0,
    },
    inputBottom: {
        borderTopLeftRadius: 0,
        borderTopRightRadius: 0,
        borderBottomLeftRadius: 6,
        borderBottomRightRadius: 6,
        marginBottom: 60
    },
// render
    <View style={[style.inputExample, style.inputTop]}>
    </View>
    <View style={[style.inputExample, style.inputBottom]}>
    </View>

The result is as expected, but with artifacts on the corners with radius:0

screen shot 2017-01-13 at 7 30 12 pm

Solution

Don't know yet

Additional Information

  • React Native version: 0.36.1
  • Platform: iOS
  • Operating System: MacOS
@frmrgr
Copy link

frmrgr commented Jan 24, 2017

I confirm, this is a nasty issue (iOS only). However in case you don't need different outer border colors/styles/widths on your blocks, you can wrap both views in a container and give it overflow:'hidden' along with needed borderRadius:6 instead of each half separately.

@farwayer
Copy link
Contributor

farwayer commented Feb 4, 2017

I just trapped into this. Enough of one corner

untitled2

@ismdcf
Copy link

ismdcf commented May 18, 2017

try using
borderWidth: StyleSheet.hairlineWidth,
might work

@shergin shergin self-assigned this May 18, 2017
@hramos hramos added the Icebox label Jul 20, 2017
@hramos
Copy link
Contributor

hramos commented Jul 20, 2017

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

@hramos hramos closed this as completed Jul 20, 2017
@malangaveuday
Copy link

same issue

@zinoviev
Copy link

zinoviev commented Aug 21, 2017

Got same for RN 0.47 and iPhone 6

In my case, it looks like exactly the same as in kirankalyan5/react-native-segmented-control-tab#10

Folks in issue above describes how to get workaround, but source problem still exists in RN

@AlexanderPinkerton
Copy link

Still an issue. Reopen and fix the bug.

@shergin shergin reopened this Oct 3, 2017
@stale
Copy link

stale bot commented Dec 2, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. 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 2, 2017
@stale stale bot closed this as completed Dec 9, 2017
@SupriyaKalghatgi
Copy link

Facing similar issue
When can we expect the fix for this

@shergin
Copy link
Contributor

shergin commented Dec 19, 2017

It was fixed in master.

@SupriyaKalghatgi
Copy link

<View>
  <View
    style={{
      margin: 20,
      width: 100,
      height: 50,
      borderWidth: 1,
      borderColor: "blue",
      borderTopLeftRadius: 5,
      borderBottomLeftRadius: 5
    }}
  />
</View>

with RN 0.53.0
img_0117

When was this fix pushed? I dont find it in RN 0.53.0 even

Reopen this issue and need fix ASAP

@ismdcf
Copy link

ismdcf commented Feb 21, 2018

@SupriyaKalghatgi did you try

<View
style={{
margin: 20,
width: 100,
height: 50,
borderWidth: StyleSheet.hairlineWidth,
borderColor: "blue",
borderTopLeftRadius: 5,
borderBottomLeftRadius: 5
}}
/>

@zinoviev
Copy link

zinoviev commented Feb 21, 2018

I was lucky enough to meet this bug in one more project. It happens only on iphone, renders fine on emulator

2018-02-21 15 25 56

@SupriyaKalghatgi
Copy link

@ismdcf Whats difference between snippet i shared and that of yours?

@shergin
Copy link
Contributor

shergin commented Feb 21, 2018

@zinoviev Is it happened on master? Have you tried this on Simulator with same pixel density as device?

@shergin shergin removed their assignment Feb 21, 2018
@shergin shergin reopened this Feb 21, 2018
@mattijsf
Copy link
Contributor

mattijsf commented May 9, 2018

@SupriyaKalghatgi I tested with 0.55.3

@SupriyaKalghatgi
Copy link

I still find this issue with iOS 11

@SupriyaKalghatgi
Copy link

@hramos @shergin Its been so long waiting for this fix

@hramos
Copy link
Contributor

hramos commented May 16, 2018

@SupriyaKalghatgi which fix? Can you link to the PR?

@SupriyaKalghatgi
Copy link

@hramos You can check the above conversation
It was said that, this issue was fixed on master, which is not actually

@mattijsf
Copy link
Contributor

0.55.4 Still there.

I'm peeking at https://github.com/facebook/react-native/blob/master/React/Views/RCTBorderDrawing.m in which I think the bug is caused. But it's pretty mumbo jumbo at first sight...

@hramos
Copy link
Contributor

hramos commented May 24, 2018

@SupriyaKalghatgi in that case, this issue is open and waiting for a fix from the community. Feel free to send a PR. Thanks!

@hramos hramos added the Help Wanted :octocat: Issues ideal for external contributors. label May 24, 2018
@SupriyaKalghatgi
Copy link

@hramos Yes, i know that the issue is still kept open

Without any fix!

@SupriyaKalghatgi
Copy link

I dont think i am free enough to send PR

@zinoviev
Copy link

@SupriyaKalghatgi I assume you one of nativebase maintainers and if you facing this issue for segmented controls it's pretty easy to implement workaround - remove opposite to round corners border with applying a style like borderRightWidth: 0. Bleeding is happening on the side without border-radius, so just remove this side entirely and let another view be its border. You may use 1pt width view if you don't have a logical neighbor.

@mattijsf
Copy link
Contributor

mattijsf commented Jun 6, 2018

I did create PR #19451 It would be great if some people can confirm if it is fixed.

@mattijsf
Copy link
Contributor

I just tested on iOS 12 beta. Same problem. My PR fixes it there too though.

@Damirikys
Copy link

Maybe someone will help it:
I just did instead of borderLeftWidth: 4 like this borderLeftWidth: StyleSheet.hairlineWidth * 6.
And it works for me.

P.S.: Tested on iPhone 6 (real device)

@gbhasha
Copy link

gbhasha commented Aug 6, 2018

@Damirikys issue still there if the borderRadius is more than the borderWidth.

@a-fortunato
Copy link

a-fortunato commented Sep 7, 2018

I'm facing this same issue, only in iOS (tested on iPhone 5s). React-native version 0.55.4.

dropDown: {
    borderBottomLeftRadius: 5,
    borderBottomRightRadius: 5,
    borderColor: 'red',
    borderWidth: 1,
}

--
Added borderStyle: 'dotted', to the dropDown style (the glitch only appears with solid borders) as a temporal workaround until it's fixed.

@Faolain
Copy link

Faolain commented Sep 17, 2018

Same issue here on Views with React-Native version 0.57.0 and Android

@hramos hramos added the Resolution: PR Submitted A pull request with a fix has been provided. label Sep 26, 2018
@plopzer
Copy link

plopzer commented Oct 4, 2018

I'm having the same artifacting issue when all 4 corners have the same border radius, but one side has a different border width.

<View style={{
  borderLeftWidth: 2,
  borderRadius: 2,
  borderColor: 'red',
  height: 50,
  width: 50
}}></View>

border issue

@hramos
Copy link
Contributor

hramos commented Oct 4, 2018

#21208 has been merged and the fix is now in master.

@hramos hramos closed this as completed Oct 4, 2018
@hramos hramos added the Resolution: Fixed A PR that fixes this issue has been merged. label Oct 4, 2018
facebook-github-bot pushed a commit that referenced this issue Feb 13, 2019
Summary:
Fixes #22824 #21945 , the bug comes from #21208 , it was to fix #11897. Now Let's constrain edge adjust only when view has corners.

[iOS] [Fixed] - Fix triangle views on iOS
Pull Request resolved: #23402

Differential Revision: D14059192

Pulled By: hramos

fbshipit-source-id: be613bf056d3cc484f281f7ea3d08f251971700a
grabbou pushed a commit that referenced this issue Apr 8, 2019
Summary:
Fixes #22824 #21945 , the bug comes from #21208 , it was to fix #11897. Now Let's constrain edge adjust only when view has corners.

[iOS] [Fixed] - Fix triangle views on iOS
Pull Request resolved: #23402

Differential Revision: D14059192

Pulled By: hramos

fbshipit-source-id: be613bf056d3cc484f281f7ea3d08f251971700a
@facebook facebook locked as resolved and limited conversation to collaborators Dec 11, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Dec 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Help Wanted :octocat: Issues ideal for external contributors. Platform: iOS iOS applications. Ran Commands One of our bots successfully processed a command. Resolution: Fixed A PR that fixes this issue has been merged. Resolution: Locked This issue was locked by the bot. Resolution: PR Submitted A pull request with a fix has been provided.
Projects
None yet