You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, in the MultiSelect component, you have a method to show/hide the Toggle All checkbox. The problem comes in this line where you are transforming the selectionLimit variable. When passing null or undefined, this transform is transforming the variable to NaN, so later your isSelectionAllDisabled method is not working as expected because ObjectUtils.isEmpty(NaN) is false.
At the end, when passing null or undefined to the selectionLimit prop, we end up not showing the Toggle All checkbox at all.
Do you have a workaround? Or other recommended way?
cetincakiroglu
added
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
and removed
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
labels
Jul 18, 2024
Describe the bug
When using MultiSelect, we have a use case where we need to pass the
selectionLimit
prop conditionally. Like this:This is the most recommended way to pass props conditionally.
So, in the MultiSelect component, you have a method to show/hide the Toggle All checkbox. The problem comes in this line where you are transforming the selectionLimit variable. When passing null or undefined, this transform is transforming the variable to
NaN
, so later yourisSelectionAllDisabled
method is not working as expected becauseObjectUtils.isEmpty(NaN)
is false.At the end, when passing null or undefined to the
selectionLimit
prop, we end up not showing the Toggle All checkbox at all.Do you have a workaround? Or other recommended way?
Thanks a lot
Last note:
Angular people told me that this is the expected behaviour for the numberAttribute transform
Environment
Reproducer
https://stackblitz.com/edit/pi4qot?file=src%2Fapp%2Fmulti-select-basic-demo.html
Angular version
18.1.0
PrimeNG version
17.18.2
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
v22.4.1
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
I should see the Toggle All checkbox when passing null or undefined to the
selectionLimit
propThe text was updated successfully, but these errors were encountered: