We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 77b068a commit b522efeCopy full SHA for b522efe
1 file changed
packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/FormLabel/index.tsx
@@ -18,13 +18,15 @@ export interface Props {
18
}
19
20
function FormLabel({ htmlFor, label, type, required }: Props) {
21
- const LabelTag = htmlFor ? "label" : "span";
22
-
23
return (
24
<>
25
- <LabelTag className="openapi-explorer__form-item-label" htmlFor={htmlFor}>
26
- {label}
27
- </LabelTag>
+ {htmlFor ? (
+ <label className="openapi-explorer__form-item-label" htmlFor={htmlFor}>
+ {label}
+ </label>
+ ) : (
28
+ <span className="openapi-explorer__form-item-label">{label}</span>
29
+ )}
30
{type && <span style={{ opacity: 0.6 }}> — {type}</span>}
31
{required && (
32
<span className="openapi-schema__required">
0 commit comments