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

<textarea spellCheck={false} /> omits spellcheck attr (should be string "false") #2649

Closed
lionel-rowe opened this issue Sep 10, 2024 · 3 comments

Comments

@lionel-rowe
Copy link
Contributor

lionel-rowe commented Sep 10, 2024

Not sure whether this is a Fresh issue (@1.7.1) or upstream. [email protected] (latest) sort-of has the same issue, but only if you write the attr name all-lowercase in JSX, whereas Fresh has the issue even if you use camel-case (in non-island components) and only has the issue for spellCheck={false} for island components.

FWIW, TypeScript accepts both the lowercase and camel-case variants, so presumably both should be supported.

Non-island component in [email protected]

JSX Expected Actual Match?
<textarea spellCheck={true} /> <textarea spellcheck="true"></textarea> <textarea spellcheck></textarea>
<textarea spellCheck={false} /> <textarea spellcheck="false"></textarea> <textarea></textarea>
<textarea spellcheck={true} /> <textarea spellcheck="true"></textarea> <textarea spellcheck></textarea>
<textarea spellcheck={false} /> <textarea spellcheck="false"></textarea> <textarea></textarea>

Island component in [email protected]

JSX Expected Actual Match?
<textarea spellCheck={true} /> <textarea spellcheck="true"></textarea> <textarea spellcheck="true"></textarea>
<textarea spellCheck={false} /> <textarea spellcheck="false"></textarea> <textarea></textarea>
<textarea spellcheck={true} /> <textarea spellcheck="true"></textarea> <textarea spellcheck="true"></textarea>
<textarea spellcheck={false} /> <textarea spellcheck="false"></textarea> <textarea spellcheck="false"></textarea>

[email protected]

JSX Expected Actual Match?
<textarea spellCheck={true} /> <textarea spellcheck="true"></textarea> <textarea spellcheck="true"></textarea>
<textarea spellCheck={false} /> <textarea spellcheck="false"></textarea> <textarea spellcheck="false"></textarea>
<textarea spellcheck={true} /> <textarea spellcheck="true"></textarea> <textarea spellcheck></textarea>
<textarea spellcheck={false} /> <textarea spellcheck="false"></textarea> <textarea></textarea>
@lionel-rowe lionel-rowe changed the title <textarea spellCheck={false} /> in non-island component omits spellcheck attr (should be string "false") <textarea spellCheck={false} /> omits spellcheck attr (should be string "false") Sep 10, 2024
@rschristian
Copy link
Contributor

rschristian commented Sep 14, 2024

Relevant: preactjs/preact#3399 & preactjs/preact-render-to-string#388

I think we will remove the spellCheck typing altogether from Preact, it shouldn't be there. Should use lowercase.

Edit: Mixed up your examples, looks like a bug in RTS if spellcheck (lowercased) isn't properly supported. Will look into getting that corrected.

@rschristian
Copy link
Contributor

Thanks for writing out the comparison, super helpful! Was indeed some funky inconsistencies in Preact.

preactjs/preact#4497 fixes the types, so spellCheck will be invalid/an error, and preactjs/preact-render-to-string#393 will ensure RTS handles spellcheck, the intended casing, properly.

@rschristian
Copy link
Contributor

Try [email protected] when you have a chance, that + lower-cased spellcheck should fix your issues.

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

No branches or pull requests

3 participants