Skip to content

Commit 18dc3c2

Browse files
committed
prevent openapi-explorer parent from getting explicit width and height from the script
1 parent c696ef8 commit 18dc3c2

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

app/views/api_docs/index.html.erb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
history.pushState = function(state, title, url) {
88
return originalPushState.call(this, state, title, URL.parse(url, location.href).href);
99
};
10+
11+
// set openapi-explorer parent width and height explicitly to prevent them being set to 100vw/100vh by the script
12+
// which leads to double scroll bars
13+
// https://github.com/Authress-Engineering/openapi-explorer/blob/49d4d32de6fd7b14a8f5f95fbfefa8cd72e72587/src/openapi-explorer.js#L191-L196
14+
const contentBody = document.getElementById('content-body');
15+
if (contentBody) {
16+
contentBody.style.width = 'auto';
17+
contentBody.style.height = 'auto';
18+
}
1019
})();
1120
<% end %>
1221

0 commit comments

Comments
 (0)