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

DetailsHTMLAttributes interface missing onToggle property #2398

Closed
pheekus opened this issue Apr 28, 2020 · 2 comments · Fixed by #2421
Closed

DetailsHTMLAttributes interface missing onToggle property #2398

pheekus opened this issue Apr 28, 2020 · 2 comments · Fixed by #2421
Labels

Comments

@pheekus
Copy link
Contributor

pheekus commented Apr 28, 2020

Stencil version:

 @stencil/core@1.12.6

I'm submitting a:

[x] bug report
[ ] feature request
[ ] support request

Current behavior:

TSX fails to complile with the following error when a toggle event listener is added on the <details> element:

Property 'onToggle' does not exist on type 'DetailsHTMLAttributes'. ts(2322)

This issue affects types only. If you do <details {...{ onToggle: console.log }} />, it works just fine, but I'm guessing this isn't the way we're supposed to add event listeners in our code :)

Expected behavior:

The toggle event should be supported in <details> with the onToggle property.

Steps to reproduce:

  1. Create a basic StencilJS project with a minimal component;
  2. Try to render the following: <details onToggle={console.log}>Content</details>.

Related code:

export interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
open?: boolean;
}

Other information:

Simply adding onToggle?: (event: Event) => void; to the interface linked above should fix it, unless I'm missing something.

@ionitron-bot ionitron-bot bot added the triage label Apr 28, 2020
@manucorporat
Copy link
Contributor

Can you provide a PR?

@pheekus
Copy link
Contributor Author

pheekus commented May 6, 2020

@manucorporat sure, here you go: #2421

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants