Dropdown with filter emits both focus and blur on focus
Current behavior When dropdown with filter is clicked, both focus and blur events are emitted at the same time. And also, the type of blur event is FocusEvent.
Expected behavior On click of dropdown with filter, only focus event should be emitted. Blur event should be emitted on blur only.
Minimal reproduction of the problem with instructions
- Use dropdown with filter and bind focus and blur events <p-dropdown [options]="cars" filter="filter" (onFocus)="onFocusHandler($event)" (onBlur)="onBlurHandler($event)">
- Click on the dropdown.
- Focus and blur events, both are triggered.
Please tell us about your environment: Operating system: Windows 8.1 Pro, IDE: Visual Studio Code 1.16.1
-
Angular version: 4.3.6
-
PrimeNG version: 4.2.0-rc.1
-
Browser: Google Chrome 61.0.3163.100 (Official Build) (64-bit)
-
Language: TypeScript 2.4
The problem still occurs in primeng version 7.0.5. It would be great if this could be fixed.
As a workaround for dropdowns with editable=false we currently use the onHide event. This event is emitted when the option panel disappears.
Hi,
We couldn't replicate the issue with the latest PrimeNG release, if the issue still exists with the latest PrimeNG version, please provide a StackBlitz example by using PrimeNG Issue Template and re-open the issue.
Regards