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

<search> HTML element is not supported in TypeScript types #4091

Closed
1 task done
crutchcorn opened this issue Aug 7, 2023 · 4 comments · Fixed by #4092
Closed
1 task done

<search> HTML element is not supported in TypeScript types #4091

crutchcorn opened this issue Aug 7, 2023 · 4 comments · Fixed by #4092

Comments

@crutchcorn
Copy link

crutchcorn commented Aug 7, 2023

  • Check if updating to the latest Preact version resolves the issue

I would like to open a PR fixing this issue, I know how to do so.

Describe the bug
A clear and concise description of what the bug is.

When using the following semantic markup:

<header>
  <h1>Movie website</h1>
  <search>
    <form action="./search/">
      <label for="movie">Find a Movie</label>
      <input type="search" id="movie" name="q" />
      <button type="submit">Search</button>
    </form>
  </search>
</header>

In Preact (using TypeScript), I get the following TypeScript error:

TS2339: Property  search  does not exist on type  JSX.IntrinsicElements 

To Reproduce

CodeSandbox doesn't appear to show TypeScript errors for invalid JSX tags.

Steps to reproduce the behavior:

  1. Add a <search> property in your Preact markup
  2. See error

Expected behavior
What should have happened when following the steps above?

<search> should be a valid HTML element, per:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/search

@JoviDeCroock
Copy link
Member

It's not supported in most browsers 😅

image it does seem supported in the DOM types so I don't see why we shouldn't

@MrGrigri
Copy link

MrGrigri commented Jun 25, 2024

This is now newly available in all browsers. Please consider reopening this issue and adding support.

image

@marvinhagemeister
Copy link
Member

@MrGrigri You might have missed the last comment prior to yours. Jovi made a PR and added support for the search element to Preact in #4092 nearly a year ago.

@MrGrigri
Copy link

🤣 Ha, you are right. Skimmed right over that one.

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 a pull request may close this issue.

4 participants