Skip to content

Clear the border path effect when borderStyle is removed on Android - #59607

Merged
javache merged 1 commit into
react:mainfrom
lazerg:fix/issue-59600-border-style-removed
Oct 29, 2026
Merged

javache merged 1 commit into
react:mainfrom
lazerg:fix/issue-59600-border-style-removed

Conversation

@lazerg

@lazerg lazerg commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Summary:

On Android, removing borderStyle: 'dashed' (or 'dotted') from a view leaves its border dashed. Both updatePathEffect overloads in BorderDrawable only set the paint's path effect inside borderStyle?.let, so once borderStyle becomes null nothing resets it and borderPaint keeps the last DashPathEffect. The else null inside the let could never run.

The path effect is now always set, and it is null when borderStyle is null.

Fixes #59600

Changelog:

[ANDROID] [FIXED] - Removing borderStyle from a view no longer leaves its border dashed or dotted

Test Plan:

Added BorderDrawableTest, which draws a dashed border, sets borderStyle to null, draws again and checks the border paint has no path effect. It fails on main and passes with this change. ./gradlew :packages:react-native:ReactAndroid:testDebugUnitTest passes and yarn format-check-kotlin is clean. I didn't run the reproducer on a device.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 29, 2026
@github-actions

Copy link
Copy Markdown

Visual regression

No visual differences at b23d0ed48738.

ios: no capture

@meta-codesync

meta-codesync Bot commented Oct 29, 2026

Copy link
Copy Markdown

@javache has imported this pull request. If you are a Meta employee, you can view this in D128304915.

@javache
javache merged commit 01145c9 into react:main Oct 29, 2026
62 of 63 checks passed
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android: removing borderStyle: 'dashed' from a View leaves its border dashed

2 participants