Skip to content

Bug: contentEditable attribute does not allow the 'plaintext-only' value #27619

@nathan-osman

Description

@nathan-osman

React version: 18.2.0

Steps To Reproduce

  1. Create a React project with TypeScript enabled
  2. Create an element with the contentEditable="plaintext-only" attribute

Reproducible example:
https://codesandbox.io/s/cool-voice-w8w7q2

The current behavior

The TypeScript compiler flags the attribute as an error:

Type '"plaintext-only"' is not assignable to type 'Booleanish | "inherit"'.ts(2322)

index.d.ts(1988, 9): The expected type comes from property 'contentEditable' which is declared here on type
  'DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>'

The expected behavior

No error is generated. This value is supported for the attribute on several popular browsers, including Chrome, Edge, Safari, and Opera.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions