-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
TreeSelect popup closes when unchecking nodes #13698
Comments
Same behavior here |
+1 also happens on PrimeNG v17.7.0, seems like it was working as expected on PrimeNG v15 - https://www.primefaces.org/primeng-v15-lts/treeselect#checkbox |
There is a workaround for this bug:
Add In your .ts:
Credit goes to Berkin Sansal - SO thread - https://stackoverflow.com/questions/76976298/how-to-prevent-overlay-of-treeselect-checkbox-auto-collapse-when-click-child-nod |
Thanks for the fix, @fkrajcar-cirtuo. However, it's a partial fix. With this fix, they can't close the treeselect by clicking on the select box. Since event is undefined, we can't tell what they clicked on to conditionally hide the overlay. |
Note that this only happens when you click on the checkbox. If you click on the label for the checkbox, things work as expected. |
Yes, that is correct, but that was not a problem in our case since clicking outside the panel (and label itself) and ESC closes it as expected. |
Here's my monkey patch of onClick() that allows med to close the overlay by clicking on the dropdown box.
|
Fixed #13698 - TreeSelect | Update condition of onClick
@cetincakiroglu , this update has caused the TreeSelect to not close when in "single" mode after making a selection. I'm not sure why this change was made, but its almost assuredly the reason for the break.
|
Hi, Thanks for letting us know, we'll check it. Could you please also share a stackblitz example and tag me so we can better understand the issue? |
@cetincakiroglu just compare the "Basic" example of Tree Select in PrimeNG 16 with the latest one in the demo site: Selecting an item is supposed to close the control. |
Hi, As @zfloyd said this fix has broken behavior that caused to close overlay in a control behavior before fixcontrol behavior after fixIs someone working on fixing this issue? |
Describe the bug
When selectionMode is set to 'checkbox', unchecking a checked tree node causes the popup to close prematurely
Environment
Issue can be reproduced in PrimeNG demo app https://primeng.org/treeselect#checkbox
Reproducer
No response
Angular version
16
PrimeNG version
16.3.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
16.20.1
Browser(s)
Chrome, Firefox
Steps to reproduce the behavior
Open PrimeNG demo page at https://primeng.org/treeselect#checkbox
Open select
Check an item
Uncheck that item
Result: Popup tree closes
Expected: Popup tree should stay open
Expected behavior
Popup tree should stay open
The text was updated successfully, but these errors were encountered: