Skip to content

Conversation

@kacperkapusciak
Copy link
Member

@kacperkapusciak kacperkapusciak commented Dec 12, 2023

Description

Screen.Recording.2023-12-12.at.11.34.21.mov

This PR adds support for border radius style props like: borderTopLeftRadius, borderTopRightRadius, borderBottomLeftRadius, borderBottomRightRadius to RectButton.

It implements the border radii by wrapping a RawButton with two Views - the outer one curves the native RawButton and the inner acts like a mask cutting the corners of the button. The radius of the inner view had to be adjusted by subtracting the borderWidth from it - see this tweet.

FIxes #2594

Copy link
Contributor

@m-bert m-bert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic looks fine, thanks for fixing that! ❤️

I'll leave review of TS part for @tjzel

Copy link
Contributor

@tjzel tjzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TS seems approvable now 🚀

@j-piasecki j-piasecki linked an issue Dec 20, 2023 that may be closed by this pull request
Copy link
Member

@j-piasecki j-piasecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@j-piasecki j-piasecki merged commit 74c01a3 into main Jan 11, 2024
@j-piasecki j-piasecki deleted the @kacperkapusciak/rectbutton-border-radius branch January 11, 2024 11:54
j-piasecki added a commit that referenced this pull request Feb 5, 2024
j-piasecki added a commit that referenced this pull request Feb 5, 2024
## Description

Reverts #2691.

During testing before release, I've found some cases where the approach
from PR doesn't work. At this point it may be better to leave the
buttons as they are so we don't break any existing setups, and possibly
reuse the logic for pressables.
@versten1uk
Copy link

Still reproduced in 2.24.0

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Buttons(iOS | Android): BorderRadius issue with styled components <RectButton> border radius behaves differently than in <View>

6 participants