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

popovertarget attribute missing in ButtonHTMLAttributes and triggers ts error #9761

Closed
1 task
salvaft opened this issue Jan 21, 2024 · 0 comments · Fixed by #9762
Closed
1 task

popovertarget attribute missing in ButtonHTMLAttributes and triggers ts error #9761

salvaft opened this issue Jan 21, 2024 · 0 comments · Fixed by #9762
Assignees
Labels
needs triage Issue needs to be triaged

Comments

@salvaft
Copy link
Contributor

salvaft commented Jan 21, 2024

Astro Info

Astro                    v4.2.1
Node                     v20.11.0
System                   Linux (x64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             @astrojs/tailwind

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

popovertarget attribute does not exist in ButtonHTMLAttributes and shows a ts error making all builds fail.

src/pages/index.astro:8:10 - error ts(2322): Type '{ children: any; popovertarget: string; }' is not assignable to type 'ButtonHTMLAttributes'.
  Property 'popovertarget' does not exist on type 'ButtonHTMLAttributes'.

    popovertarget="nav-menu"
       ~~~~~~~~~~~~~

image

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#popovertarget

What's the expected result?

popovertarget attribute should be part of the ButtonHTMLAttributes

Can be fixed by extending JSX attributes using a custom-attributes.d.ts file

declare namespace astroHTML.JSX {
  interface ButtonHTMLAttributes {
    popovertarget?: string;
  }
}

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-knhwyx?file=package.json

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Jan 21, 2024
@ematipico ematipico transferred this issue from withastro/astro Jan 22, 2024
@Princesseuh Princesseuh transferred this issue from withastro/language-tools Jan 22, 2024
@ematipico ematipico self-assigned this Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants