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

handle object type listeners #114

Merged
merged 2 commits into from
Jun 22, 2024
Merged

Conversation

keithjgrant
Copy link
Contributor

@keithjgrant keithjgrant commented Jun 6, 2024

According to MDN the function signature for addEventListener should support a listener that is a function, or an object with a handleEvent() method, or null.

Currently only functions are supported. This makes it so I cannot use <code-input> inside a Lit component (it throws a "not a function" error), as Lit passes in an object.

These changes update the addEventListener override to support all three types.

@WebCoder49
Copy link
Owner

WebCoder49 commented Jun 8, 2024

Thank you very much for this! I will review, merge and release it within a week.

Sorry - that wasn't true. I was busier than I thought.

@WebCoder49
Copy link
Owner

This has been tested both on Firefox+X11+Ubuntu and Chrome Mobile+Android.

@WebCoder49 WebCoder49 merged commit 8b00e12 into WebCoder49:main Jun 22, 2024
@WebCoder49
Copy link
Owner

@keithjgrant, I have released this in version 2.3.1. Thank you for the suggestion!

I have noticed I am quite prone to setting unrealistically early targets for myself like I did here and have done in various contexts before. I will mention this publicly here as a way to remind me in the future.

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.

2 participants