Skip to content

JSX boolean attribute "readOnly" should not use string values #4917

Closed

Description

@locomotif

Q&A (please complete the following information)

  • OS: macOS
  • Browser: Chrome
  • Version: 69.0.3497.100 (Official Build) (64-bit)
  • Method of installation: yarn
  • Swagger-UI version: 3.19.0
  • Swagger/OpenAPI version: 3.19.0

To reproduce...

This is not necessarily a bug, but maybe a react best practice. When executing a sample rest endpoint, I am noticing a warning on the console. Please see screenshot below. The issue originates from swagger-ui/src/core/components/curl.jsx

Please note the readOnly attribute

<textarea onFocus={this.handleFocus} readOnly="true" className="curl" style={{ whiteSpace: "normal" }} value={curl}></textarea>
// ...should be
<textarea onFocus={this.handleFocus} readOnly className="curl" style={{ whiteSpace: "normal" }} value={curl}></textarea>

Expected behavior

I expect no warnings

Screenshots

image

Activity

  1. changed the title [-]React attributes[/-] [+]React boolean attributes should not use string values[/+] on Oct 2, 2018
  2. changed the title [-]React boolean attributes should not use string values[/-] [+]JSX boolean attribute "readOnly" should not use string values[/+] on Oct 2, 2018
  3. hkosova commented on Aug 8, 2019

    @hkosova
    Contributor

    PR: #5497

  4. shockey commented on Aug 23, 2019

    @shockey
    Contributor

    fixed in #5497!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions