Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

reactjs remove spellcheck attribute

Tags:

reactjs

I'm using ReactJS to render my DOM.

I want to add the spellcheck="false" attribute on a text input, so I do this:

render() {
    return (
        <div>   
                <input type="text" placeholder="Name" spellcheck="false" />
        </div>
    )
}

Then, when I inspect with chrome, the spellcheck attribute is not present.

like image 485
Alex Trupin Avatar asked Mar 02 '18 23:03

Alex Trupin


People also ask

How do I turn off spell check in react?

Disable SpellCheck To disable spell check in Document Editor, set enableSpellCheck property as false or remove enableSpellCheck property initialization code. The default value of this property is false.

Can you turn off spell check in forms?

Spell Check feature can be enabled/disabled using an attribute called spellcheck which defines whether the HTML element will be checked for the errors or not. It takes two values, either true or false.

How do I turn off spell check in textarea?

To disable spell check in textarea atrribute spellcheck=”false” can be used.


1 Answers

Try using spellCheck instead. (Note the capital C)

The docs are good for explaining how default HTML attributes should be referenced in React.

like image 61
Danny Delott Avatar answered Sep 23 '22 00:09

Danny Delott