Skip to content

Update border geometry when layout direction changes on Android (#60161) - #60161

Merged
meta-codesync[bot] merged 1 commit into
react:mainfrom
jasozh:export-D132253217
Nov 26, 2026
Merged

meta-codesync[bot] merged 1 commit into
react:mainfrom
jasozh:export-D132253217

Conversation

@jasozh

@jasozh jasozh commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

Fixes an issue where border radius on drawables is not updated when the direction style changes on Android.

Root Cause

Background, border, and background image drawables cache paths built from the resolved border radii and widths. When a mounted view's layout direction changed by toggling the direction style, logical values such as borderTopStartRadius kept their previous physical corners and edges. The view's outline, used for the elevation shadow, had the same problem.

This PR

Override onLayoutDirectionChanged() to add invalidateSelf() for BackgroundDrawwable, BackgroundImageDrawable, BorderDrawable, and CompositeBackgroundDrawable.

Changelog: [Android][Fixed] - Fix logical border radii and widths not updating when a view's layout direction changes at runtime

Reviewed By: vzaidman

Differential Revision: D132253217

@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 Nov 19, 2026
@meta-codesync

meta-codesync Bot commented Nov 19, 2026

Copy link
Copy Markdown

@jasozh has exported this pull request. If you are a Meta employee, you can view the originating Diff in D132253217.

jasozh added a commit to jasozh/react-native that referenced this pull request Nov 23, 2026
…t#60161)

Summary:
Pull Request resolved: react#60161

Fixes an issue where border radius on drawables is not updated when the direction style changes on Android.

### Root Cause

Background, border, and background image drawables cache paths built from the resolved border radii and widths. When a mounted view's layout direction changed by toggling the `direction` style, logical values such as `borderTopStartRadius` kept their previous physical corners and edges. The view's outline, used for the `elevation` shadow, had the same problem.

### This PR

Override `onLayoutDirectionChanged()` to add `invalidateSelf()` for BackgroundDrawwable, BackgroundImageDrawable, BorderDrawable, and CompositeBackgroundDrawable.

Changelog: [Android][Fixed] - Fix logical border radii and widths not updating when a view's layout direction changes at runtime

Reviewed By: vzaidman

Differential Revision: D132253217
@meta-codesync meta-codesync Bot changed the title Update border geometry when layout direction changes on Android Update border geometry when layout direction changes on Android (#60161) Nov 23, 2026
…t#60161)

Summary:

Fixes an issue where border radius on drawables is not updated when the direction style changes on Android.

### Root Cause

Background, border, and background image drawables cache paths built from the resolved border radii and widths. When a mounted view's layout direction changed by toggling the `direction` style, logical values such as `borderTopStartRadius` kept their previous physical corners and edges. The view's outline, used for the `elevation` shadow, had the same problem.

### This PR

Override `onLayoutDirectionChanged()` to add `invalidateSelf()` for BackgroundDrawwable, BackgroundImageDrawable, BorderDrawable, and CompositeBackgroundDrawable.

Changelog: [Android][Fixed] - Fix logical border radii and widths not updating when a view's layout direction changes at runtime

Reviewed By: vzaidman

Differential Revision: D132253217

@vzaidman vzaidman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

@github-actions

Copy link
Copy Markdown

Visual regression

No visual differences at 4b8adff59663.

ios: no capture

@meta-codesync
meta-codesync Bot merged commit c3b3eaa into react:main Nov 26, 2026
61 checks passed
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @jasozh in c3b3eaa

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Nov 26, 2026
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. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants