p-dropdown: onBlur is been called on selection, without lost focus, and before onChange #14128
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
Dear Fellows,
It seems to me that onBlur shoud not be called on option selection in pDropDown, and when an options is chosen, the control has not lost focus yet, and p-dropdown is calling onBlur at that time..
And in my case it seems to be called moments before the data (option) actually has been changed (what fires onChange), and I have a validation which occurs on onBlur.
The wordaround (very ugly in fact) i found is to have a timer to wait 100-200ms in onBlur step to wait for the option be filled so I can dispatch a validation.
What do you think?
Should p-Dropdown deal with it, or simply dont dispatch onBlur if it has not lost focus?
Thanks in advance.
Environment
angular v16
Reproducer
No response
Angular version
v16.2
PrimeNG version
v16.6.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
lastest
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: