vite-plugin-solid icon indicating copy to clipboard operation
vite-plugin-solid copied to clipboard

`spellcheck={false}` does not disable spellcheck

Open Jacob-Lockwood opened this issue 10 months ago • 0 comments

The spellcheck global attribute must be either the empty string, the string true (both enabling spellcheck), or the string false. If you don't set it, its default is browser-dependent.

In solid JSX, spellcheck's type is boolean, but setting spellcheck={false} (seemingly specifically with the Vite plugin?) does not make the html spellcheck="false" but rather doesn't set the spellcheck value at all, which in at least my browser defaults to enabling it.

I have worked around this by including a //@ts-ignore comment above spellcheck="false".

Here is a demo of the issue: https://stackblitz.com/edit/vitejs-vite-kedhfxiu?file=src%2FApp.tsx

In the SolidJS Playground, the field with spellcheck={false} correctly sets the spellcheck attribute to false, but in a Vite setup, the attribute is unset.

I expected setting spellcheck={false} to set the spellcheck attribute to false, but it actually did nothing. I had to instead write spellcheck="false", which yields a type error.

Image Image
  • OS: macOS
  • Browser: Arc (Chromium 134.0.6998.89)
  • Version: 1.86.0

Jacob-Lockwood avatar Mar 23 '25 11:03 Jacob-Lockwood