diff --git a/.changeset/quick-colts-trade.md b/.changeset/quick-colts-trade.md new file mode 100644 index 000000000..d761e733f --- /dev/null +++ b/.changeset/quick-colts-trade.md @@ -0,0 +1,5 @@ +--- +"@gitbook/react-openapi": patch +--- + +Fix Scalar Try it button justification diff --git a/packages/react-openapi/src/OpenAPICodeSample.tsx b/packages/react-openapi/src/OpenAPICodeSample.tsx index 1f40d5117..194438b38 100644 --- a/packages/react-openapi/src/OpenAPICodeSample.tsx +++ b/packages/react-openapi/src/OpenAPICodeSample.tsx @@ -214,7 +214,7 @@ function OpenAPICodeSampleFooter(props: { const { specUrl } = context; const hideTryItPanel = data['x-hideTryItPanel'] || data.operation['x-hideTryItPanel']; const hasMultipleMediaTypes = - renderers.length > 1 || renderers.some((renderer) => renderer.examples.length > 0); + renderers.length >= 2 || renderers.some((renderer) => renderer.examples.length >= 2); // Check if any server has a host that can be used in an HTTP request const hasValidHost = hasValidServerHost(servers);