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

fix(conditionalPanel): Coerce condition result to boolean #4127

Merged
merged 8 commits into from
Sep 27, 2024

Conversation

gadenbuie
Copy link
Member

Fixes #4126

The key fix here is to force the result of condFunc() to be boolean so that it can be correctly compared with the current state of the conditionalPanel().

condFunc() is created by scopeExprToFunc() which was previously typed as returning a boolean value. In practice, however, this function returns an unknown value depending on the user expression. scopeExprToFunc() is sufficiently general to be useful in other places, so I relaxed the type from boolean to unknown (rather than doing the boolean coercion before returning). This also then gives a hint to users of condFunc() that they should verify the return value.

@gadenbuie gadenbuie marked this pull request as ready for review September 13, 2024 13:09
@schloerke schloerke merged commit 9d12b0f into main Sep 27, 2024
11 checks passed
@schloerke schloerke deleted the fix/4126-conditional-predicate branch September 27, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite loop with conditionalPanel
2 participants