Skip to content

ANDROID: Disabled background color incorrectly overrides buttonStyle background color #3985

@Mihai-github

Description

@Mihai-github

Is there an existing issue for this?

  • I have searched the existing issues

Explain what you did

Change the button background color based on the disabled value

Expected behavior

The button background color changes when disabled is false, using the background color added in buttonStyle.

Describe the bug

When the button is disabled, it correctly uses disabledStyle.backgroundColor. The issue is that when disabled becomes false, it doesn’t switch back to the background color from buttonStyle and keeps the one from disabledStyle. Even w/o setting up the disabledStyle background color, it defaults to the default background color of a button when disabled, but not to the one used in button style.

Steps To Reproduce

1. Create a simple button.
2. Use useState to toggle disabled between true and false.
3. Set one background color in buttonStyle and another in disabledStyle.

Expected:
Background color switches between buttonStyle and disabledStyle based on the disabled state.

Actual:
Background color remains the one from disabledStyle even when disabled is false.

Screenshots

No response

Your Environment

React Native Elements Env Info

Global Dependencies:

No related dependency found

Local Dependencies:

  • @rneui/base : edge
  • @rneui/themed : edge
  • react : 19.1.0
  • react-native : 0.80.2
  • @types/react : ^19.1.0
  • @types/react-native : 0.73.0

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Closed or Merged 🏁

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions