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

Change event is being called twice when using custom search #2274

Closed
HigorMichelotti opened this issue Aug 16, 2023 · 4 comments
Closed

Change event is being called twice when using custom search #2274

HigorMichelotti opened this issue Aug 16, 2023 · 4 comments
Assignees

Comments

@HigorMichelotti
Copy link

HigorMichelotti commented Aug 16, 2023

Describe the bug
Change event is being called twice when using custom search

Reproducbile example
Example: https://stackblitz.com/edit/angular-6bd5zv?file=src%2Ftemplate-search-example.component.html
Error: Notice that in the console it is possible to see the change being executed twice

To Reproduce
To view the error just filter an element and then select one of the filtered elements, for some reason it fires the change event twice instead of once.

Note: sometimes it doesn't happen the first time, you must redo the filter and select a filtered element again to see the change event being executed twice.

Note: this does not occur when we are not using the custom search

Expected behavior
The correct thing to happen in this scenario is that the change event was executed only once

Desktop (please complete the following information):

  • Browser [Chrome]
  • Version [115.0.5790.110]

GIF
2023-08-16-16-53-05

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions 🎆

@github-actions github-actions bot added the stale label Oct 16, 2023
@ricardomac
Copy link

up

@github-actions github-actions bot removed the stale label Oct 17, 2023
@pavankjadda pavankjadda self-assigned this Oct 20, 2023
@ricardomac
Copy link

nothing here?

@pavankjadda
Copy link
Collaborator

This is caused by using

@Output('change') changeEvent = new EventEmitter();

same name as default HTML change() event. This causes name collision and triggers events 2 times. There is nothing we can do since it will break many apps if we try to rename it.

@pavankjadda pavankjadda closed this as not planned Won't fix, can't repro, duplicate, stale May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants