From c6cc48c939e15178d53179b541d4e2c0599c4a27 Mon Sep 17 00:00:00 2001 From: Oliwia Rogala Date: Thu, 15 Feb 2024 10:17:24 +0100 Subject: [PATCH] fix: associate HTML labels with inputs Refs #8879 --- src/core/components/auth/api-key-auth.jsx | 9 +++- src/core/components/auth/basic-auth.jsx | 28 +++++++++--- src/core/components/param-body.jsx | 10 ++++- .../components/parameter-include-empty.jsx | 16 ++++--- src/core/components/parameters/parameters.jsx | 9 +++- .../oas3/components/auth/http-auth.jsx | 45 ++++++++++++++----- 6 files changed, 89 insertions(+), 28 deletions(-) diff --git a/src/core/components/auth/api-key-auth.jsx b/src/core/components/auth/api-key-auth.jsx index 6c22e3a8975..f85c6014c05 100644 --- a/src/core/components/auth/api-key-auth.jsx +++ b/src/core/components/auth/api-key-auth.jsx @@ -69,7 +69,14 @@ export default class ApiKeyAuth extends React.Component { { value ? ****** - : + : + + } { diff --git a/src/core/components/auth/basic-auth.jsx b/src/core/components/auth/basic-auth.jsx index baa5268ffc9..f982f71f624 100644 --- a/src/core/components/auth/basic-auth.jsx +++ b/src/core/components/auth/basic-auth.jsx @@ -65,20 +65,34 @@ export default class BasicAuth extends React.Component { - + { username ? { username } - : + : + + } - + { username ? ****** - : + : + + } { diff --git a/src/core/components/param-body.jsx b/src/core/components/param-body.jsx index 3ac5a21e88e..11eeef9f7b9 100644 --- a/src/core/components/param-body.jsx +++ b/src/core/components/param-body.jsx @@ -2,6 +2,7 @@ import React, { PureComponent } from "react" import PropTypes from "prop-types" import { fromJS, List } from "immutable" import { getKnownSyntaxHighlighterLanguage } from "core/utils/jsonParse" +import createHtmlReadyId from "core/utils/create-html-ready-id" const NOOP = Function.prototype @@ -118,6 +119,9 @@ export default class ParamBody extends PureComponent { language = "json" } + const regionId = createHtmlReadyId(`${pathMethod[1]}${pathMethod[0]}_parameters`) + const controlId = `${regionId}_select` + return (
{ @@ -137,14 +141,16 @@ export default class ParamBody extends PureComponent {
} -