Skip to content

Add writingsuggestions as a recognized booleanish attribute#36371

Open
jgbiispo wants to merge 1 commit intofacebook:mainfrom
jgbiispo:main
Open

Add writingsuggestions as a recognized booleanish attribute#36371
jgbiispo wants to merge 1 commit intofacebook:mainfrom
jgbiispo:main

Conversation

@jgbiispo
Copy link
Copy Markdown

Add writingsuggestions as a recognized booleanish attribute

writingsuggestions is a global HTML attribute that controls whether
the browser offers writing suggestions (autocorrect, autocomplete, etc.).
It is an enumerated attribute accepting "true" and "false", similar to
draggable and spellCheck.

Previously, passing writingsuggestions={false} would silently remove
the attribute from the DOM. Now it correctly sets the attribute to the
string "false".

Summary

writingsuggestions is a global HTML attribute introduced in the HTML Living Standard. It accepts "true" (default) or "false" as values, making it a booleanish/enumerated attribute — similar to draggable and spellCheck, not a pure boolean like credentialless.

Before this change:

  • <div writingsuggestions={false} /> would remove the attribute entirely (React's default behavior for unknown attributes receiving false)
  • <div WritingSuggestions="false" /> would produce no casing suggestion

After this change:

  • writingsuggestions={true} renders as writingsuggestions="true"
  • writingsuggestions={false} renders as writingsuggestions="false"
  • Incorrect casing like WritingSuggestions triggers: "Invalid DOM property WritingSuggestions. Did you mean writingsuggestions?"
  • Behavior is consistent across client rendering, SSR (ReactDOMServer), and hydration.

How did you test this change?

Added tests covering:

  • Casing suggestion (SSR): WritingSuggestions triggers the correct warning pointing to writingsuggestions
  • Booleanish rendering: {true}"true", {false}"false" on the DOM attribute
  • Server integration: both values render correctly via renderToString and hydrate without mismatch
yarn test --no-watchman ReactDOMComponent-test
yarn test --no-watchman ReactDOMServerIntegrationAttributes-test
yarn test --no-watchman DOMPropertyOperations-test

Add writingsuggestions as a recognized booleanish attribute

`writingsuggestions` is a global HTML attribute that controls whether
the browser offers writing suggestions (autocorrect, autocomplete, etc.).
It is an enumerated attribute accepting "true" and "false", similar to
`draggable` and `spellCheck`.

Previously, passing `writingsuggestions={false}` would silently remove
the attribute from the DOM. Now it correctly sets the attribute to the
string "false".
@meta-cla meta-cla Bot added the CLA Signed label Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant