Skip to content
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

Compiler error: [p-autoComplete] Argument of type 'Event' is not assignable to parameter of type 'MouseEvent' #13227

Closed
igordanilovski opened this issue Jun 19, 2023 · 2 comments
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@igordanilovski
Copy link

Describe the bug

In this specific case:
<p-autoComplete #autoComplete styleClass="p-custom-autocomplete default-input-field" [(ngModel)]="selectedPlaceShownText" [suggestions]="placesPredictions!" (onSelect)="selectPlace($event)" (onClear)="closeDropdown()" (completeMethod)="searchPlaces($event)" (onFocus)="autoComplete.handleDropdownClick($event)"

When compiling the app, the compiler gives me the following error:
image

There is definitely something wrong with the package because here the param is Event (autocomplete.d.ts)
image

But the function requires MouseEvent as a param.
image

I can't fix this issue and can't find any workaround so I think the team should look into this.

Environment

Local.

Reproducer

No response

Angular version

16.1.0

PrimeNG version

16.0.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

No response

Expected behavior

It should be changed to Event, probably... As I saw that was used in previous versions.

@igordanilovski igordanilovski added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jun 19, 2023
@volvachev
Copy link
Contributor

Hi, I don't quite understand what the click method and the focus event have to do with it?
click !== focus - why you used click for that?

workaround for you case

(onFocus)="onFocus($event)"

public onFocus(event: Event) {
  this.autoCompleteRef.handleDropdownClick(event as MouseEvent);
}

@igordanilovski
Copy link
Author

igordanilovski commented Jun 20, 2023

Thanks, I will try it, but I think that this is a bug on their side, I think. I have this code since Angular 15 and primeng 15 version, nothing is changed, but after installing primeng 16 I think this started as an issue. With initial release 16.0.0-rc1 there wasn't any issue, but after that this issue appeared.

@cetincakiroglu 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 Jun 21, 2023
@cetincakiroglu cetincakiroglu added this to the 16.0.2 milestone Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

3 participants