-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
MultiSelect: touched form property doesn't respect updateOn blur #14780
Comments
I made another StackBlitz with the same exact code but using Angular 14.3.0 and PrimeNG 14.2.3 that shows the same exact code working properly. |
Hi, Could you please replace the app link by editable link? |
Sorry about that. I was going to fast and clicked the wrong copy button |
Hi, Thanks for the example, we'll investigate the behavior. Changing the milestone to 17.8.0 because it'll take time to identify the source of the defect and provide a solution without any breaking change. |
Hi, this bug was introduced with commit-id: 0cdb8bd for version 16.7.0 |
Fix #14780 - Fix multiselect instantly call onModelTouched
Describe the bug
When I use the p-multiSelect in a formGroup and set the updateOn to blur, I would expect the touched property to remain false until I've click outside of the p-multiSelect component and the overlay closes.
In the source, the 2 places I see onModelTouched are in onOverlayAnimationStart and onInputBlur
I tried to debug a little with StackBlitz using preventModelTouched to see how the onInputBlur was behaving. I also dump the AnimationEvent to see when the visible and void states occur.
My goal is to allow a user to make a selection without validation being presented until the user is done making selections. Presumably, that's on blur.
Environment
Windows 10, Edge Version 121.0.2277.106 (Official build) (64-bit)
Reproducer
https://stackblitz.com/edit/stackblitz-starters-hu8uwy?file=src%2Fmain.ts
Angular version
17.1.2, 16.2.12
PrimeNG version
17.6.0, 16.9.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.16.0
Browser(s)
No response
Steps to reproduce the behavior
Click the Select A Make p-multiSelect dropdown and don't click anywhere else. The touched line turns from false to true immediately after clicking.
Expected behavior
On page load the touched value is false. When I click the p-multiSelect I expect touched to remain false. Then, when I click outside the p-multiSelect I expect touched to be true.
The text was updated successfully, but these errors were encountered: