Skip to content

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

@locomotif

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

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