Skip to content

Css transitionProperty breaking color inheritance in React Native #426

@yaminyassin

Description

@yaminyassin

Describe the issue

When using transitionProperty with color in a button with a span inside, the html.span color breaks on native and defaults the inherited color to black.

In web the text colors transitions but in RN the colors de colors breaks when transition starts and doesn't recover unless you reload the app

This code was tested with experimental pointer events active following this react-native guide

The test was made with expo sdk 54 and react-strict-dom 0.0.54

rsd-transition.mp4

to test just try and run the following code:


import { css, html } from "react-strict-dom";

export function AlertBanner() {
  return (
    <html.button style={styles.container}>
      <html.span style={styles.text}>Alert Banner</html.span>
    </html.button>
  );
}
const styles = css.create({
  container: {
    padding: "32px",
    transitionProperty: "backgroundColor, color",
    transitionDuration: "300ms",
    backgroundColor: {
      default: "blue",
      ":active": "darkblue",
    },
    color: {
      default: "white",
      ":active": "green",
    },
  },
  text: {
    fontSize: "24px",
    color: "inherit",
  },
});


Expected behavior

Inherited text color should transition from white to green when button is pressed

Steps to reproduce

the following was tested with expo sdk 54 and react-strict-dom 0.0.54

  1. setup RSD with expo
  2. enable experimental pointer events
  3. add the test code and press the button

Test case

No response

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions