Skip to content

[iOS] Fixes right border stretching when the left side has a corner while the right side does not#50463

Closed
zhongwuzw wants to merge 2 commits into
react:mainfrom
zhongwuzw:features/fix_border_strech
Closed

[iOS] Fixes right border stretching when the left side has a corner while the right side does not#50463
zhongwuzw wants to merge 2 commits into
react:mainfrom
zhongwuzw:features/fix_border_strech

Conversation

@zhongwuzw

Copy link
Copy Markdown
Contributor

Summary:

Fixes #46801. If the left side has a corner while the right side does not, it seems that iOS stretches the right border. Therefore, we can add 1 point to create a gap between the stretchable region and the border.

Changelog:

[IOS] [FIXED] - Fixes right border stretching when the left side has a corner while the right side does not

Test Plan:

Repro please see #46801

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Apr 3, 2025
@zhongwuzw

Copy link
Copy Markdown
Contributor Author

@joevilches Hi, can you help me to review this? Thanks :)

@joevilches

Copy link
Copy Markdown
Contributor

@zhongwuzw Hey thanks for the ping! I chatted with @jorge-cab who is more of an expert at borders than I am, and he thinks there might be other cases that cause this and would want to look into it a bit further and try to find a different repro. Ultimately he feels we can solve this in a more general sense. I'll contact him and let him know about this PR!

@jorge-cab

Copy link
Copy Markdown
Contributor

@zhongwuzw I've run into this issue before and I don't think this solution deals with every case where the issue happens, its not only with decimals on borderWidth but also with decimals on borderRadius corners and can happen on any side of a View

With your changes we still run into this with topleft and topright corners for example Screenshot 2025-04-24 at 2 26 08 PM

I'd say we need a better understanding of why this happens so we can confidently accept a fix for this, because otherwise we might end up just covering up the issue with hacky fixes without addressing the root problem

@zhongwuzw

Copy link
Copy Markdown
Contributor Author

@jorge-cab Thanks for your review. The bottom border stretching can also be fixed by adding 1 point. Actually, I debugged the drawing logic and did not find any issues, it seems the drawing logic is right. :)

@jorge-cab

Copy link
Copy Markdown
Contributor

@zhongwuzw I think we need more thorough testing for this, since I can still find ways to trigger the bug.
Screenshot 2025-04-25 at 10 54 53 AM

I think to accept a fix we need:

  • Understand what logic is causing the bug (It can be on Apple's side of things) or at least what API
  • Find exactly what triggers it. Right now we only know sometimes it is triggered by decimals on either borderWidth, or borderRadius. But what specific combinations trigger it? Does the radius have to be greater than half of the width/height of the view? Maybe it has something to do with the scaling we do with overlapping radii?

I'm not a fan of adding arbitrary pixels without a deeper understanding of the issue

@react-native-bot

Copy link
Copy Markdown
Collaborator

This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@react-native-bot

Copy link
Copy Markdown
Collaborator

This PR is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label.

@react-native-bot react-native-bot added Stale There has been a lack of activity on this issue and it may be closed soon. and removed Stale There has been a lack of activity on this issue and it may be closed soon. labels Oct 23, 2025
@react-native-bot

Copy link
Copy Markdown
Collaborator

This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@react-native-bot react-native-bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Apr 21, 2026
@react-native-bot

Copy link
Copy Markdown
Collaborator

This PR was closed because it has been stalled for 7 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. Stale There has been a lack of activity on this issue and it may be closed soon.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with TextInput borderWidth style with decimal value

5 participants