React UI Components for macOS High Sierra and Windows 10
Server Side Rendering library for React Router v4.
A pure PHP library for reading and writing word processing documents
This issue still occurs in production environment and happens quite a lot using latest NextJS.
Full reproduction available here: https://codesandbox.io/s/nostalgic-night-z6i07y?file=/src/App.tsx
Video of the bug:
The gist of the bug can be simplified to this:
import styled from "styled-components";
const MyComponent = styled("div")<{ disabled: boolean; }>`
button:active & {
background-color: ${({ disabled }) => disabled ? "transparent" : "red"};
}
`;
In the code sandbox, toggling the disabled prop will change the expected active color of the span element.
In the code sandbox above, the expected behavior would be for the a:active > &
color to return to the default one when the disabled toggle is switched off.
In the code sandbox above, the actual behavior i for the a:active > &
color to remain on the disabled one after toggling the disabled prop at least once.
I have the same issue. It is intermittent as well, one time it will work, then it won't.