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

fix: Change hasHostListenerAttached from var to protoype property #6074

Conversation

dwirz
Copy link
Contributor

@dwirz dwirz commented Dec 3, 2024

What is the current behavior?

When a component with event listeners is mounted multiple times, the event listeners are only registered for the first instance. This leads to unexpected behavior for subsequent instances.

GitHub Issue: fixes #6066

What is the new behavior?

Event listener registration is now handled on a per-instance basis. This ensures that each mounted instance of the component registers and manages its event listeners independently.

Documentation

No updates required. 😊

Does this introduce a breaking change?

  • Yes
  • No

Testing

A new test has been added to verify that event listeners are correctly registered and fired when a component is mounted twice. This ensures consistent behavior across instances.

Other information

The bug was introduced as a result of change #6052.

@dwirz dwirz requested a review from a team as a code owner December 3, 2024 16:37
@dwirz
Copy link
Contributor Author

dwirz commented Dec 6, 2024

Hi @christian-bromann / @tanner-reits,
Would you have a moment to review this? It would really help us move forward and get a workable release out soon. Thanks so much in advance! 😊

@johnjenkins
Copy link
Contributor

@dwirz I believe members of the team are away atm. I'm sure they'll review when able

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work 👏 one question though:

@christian-bromann christian-bromann added this pull request to the merge queue Dec 9, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 9, 2024
@christian-bromann christian-bromann added this pull request to the merge queue Dec 9, 2024
Merged via the queue into stenciljs:main with commit ee4aa0b Dec 9, 2024
88 checks passed
@dwirz
Copy link
Contributor Author

dwirz commented Dec 10, 2024

Thank you @christian-bromann! 🤗

@dwirz dwirz deleted the fix/change-listener-attached-flag-from-global-var-to-prop branch December 20, 2024 13:40
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

Successfully merging this pull request may close these issues.

bug: stencil core 4.22.3 listener
3 participants