Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing cssTransitionfalse does not disable animations globally #7417

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

tneeraja95
Copy link
Contributor

@tneeraja95 tneeraja95 commented Nov 14, 2024

Defect Fixes

When submitting a PR, please also create an issue documenting the error and manually link to an issue or mention it in the description using #<issue_id>.

Fix #7395

Description -
Problem is in file PrimeReactContext.js, line 15

const [cssTransition, setCssTransition] = useState(propsValue.cssTransition || true);

|| is OR, which basically means that even when cssTransition from props is false, false || true return true.

Instead of OR what we really want is 'Nullish coalescing operator (??)', which returns its right-hand side operand when its left-hand side operand is null or undefined, and otherwise returns its left-hand side.

Updating the same for other props as well.

Copy link

vercel bot commented Nov 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Updated (UTC)
primereact ⬜️ Ignored (Inspect) Visit Preview Nov 14, 2024 1:53pm
primereact-v9 ⬜️ Ignored (Inspect) Visit Preview Nov 14, 2024 1:53pm

@melloware melloware added the Type: Bug Issue contains a defect related to a specific component. label Nov 14, 2024
@melloware
Copy link
Member

Yeah I wonder if all those should be ?? as well? Can you make that change?

@tneeraja95
Copy link
Contributor Author

Thanks @melloware. Doing the same for other props as well in the same PR.

@melloware melloware merged commit e7dc619 into primefaces:master Nov 14, 2024
4 checks passed
@tneeraja95 tneeraja95 deleted the cssTransition-bug branch November 18, 2024 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PrimeReactProvider: cssTransition false does not disable animations globally
2 participants