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

spellCheck property not working #3399

Closed
phm07 opened this issue Jan 8, 2022 · 8 comments
Closed

spellCheck property not working #3399

phm07 opened this issue Jan 8, 2022 · 8 comments
Labels

Comments

@phm07
Copy link

phm07 commented Jan 8, 2022

I am using TypeScript to bundle JSX for use with preact. I noticed that the "spellCheck" property on input elements is not working correctly. <input spellCheck={false} /> doesn't even render the property in the DOM, <input spellCheck="false" /> works, but there is a TypeScript error because it doesn't fit the definition.

@developit
Copy link
Member

@pauhull the correct property to use if you're setting a boolean value is spellcheck (lower-case):

<input spellcheck={false} />

The spellCheck prop will always be set as an HTML attribute, and the HTML spellcheck attribute is a boolean attribute. I think we patch a few of these awkward behaviors, but this isn't one of them.

@JoviDeCroock
Copy link
Member

@developit do we want to patch this in compat?

@developit
Copy link
Member

I'd prefer not to, since the mappings will grow large.

@JoviDeCroock
Copy link
Member

In that case shall we close this as we have a fix here

@martpet
Copy link

martpet commented Aug 14, 2024

Only spellcheck="false" works, but it produces a Typescript error.

@rschristian
Copy link
Member

@martpet spellcheck={false} works just fine from my tests. Can you share any more info?

@martpet
Copy link

martpet commented Aug 15, 2024

In this example it doesn't work - github repo (preview), though I'm using "preact-render-to-string", if it matters.

@rschristian
Copy link
Member

Yes, rts matters a lot -- it's a different environment entirely.

Care to open an issue? I'll try to take a look at that later, schedule permitting.

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

No branches or pull requests

5 participants