-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overlapping the try it window with the response details in Mobile view #30
Comments
one more related issue, https://drive.google.com/file/d/1OkjligvZ0ZrdssWMjZg2UWEJraHG31PU/view?usp=sharing
|
This is currently the case. This is because there is only one swagger-ui interface on the entire page, which is almost positioned relative to the entire body, and the implementation is displayed where the corresponding api is located. When dynamically changing the size of an element in the page (for example, when changing the width of the browser window), it should be necessary to change the position again. This can currently be mitigated by re-updating this positioning when certain events are found on the page. But that doesn't seem like a good approach. |
Now you can try version [email protected] to verify that the problem is fixed. |
Thanks |
This has caused another issue. the window never closes even after navigating to another page |
Since I basically don't use redoc, I haven't found many problems. sorry. How can I see the navigation bar in your video? Is it some version of redoc? |
Please try it out with this code, and if the issue is resolved, I'll merge it into the master branch for a release. https://github.com/wll8/redoc-try/blob/1dadc5b27c3adeecf4efaeb23736008e795bda52/try.js |
It looks fine. Please merge this to release |
Now you can try version [email protected] to verify that the problem is fixed. |
Hi, |
Currently listening to redoc_dom being clicked, and then updating swagger-ui . If the page is changed through history.push, redoc-try cannot know. Do you accept an api such as window.initTry.renderPos for actively updating swagger-ui? Please try it out with this code, and if the issue is resolved, I'll merge it into the master branch for a release. https://github.com/wll8/redoc-try/raw/2f8b6b9095d95770d548829227ab22b749f3785b/try.js |
how do you use window.initTry.renderPos api? |
In general, you don't need to use this api, it is used when the position of swagger-ui is not updated.
|
I tried this. not working useEffect(() => { |
What it actually does is: const isVisibleRes = isVisible(document.querySelector(`.try .fullApiBox`))
// Destroy swagger-ui if redoc_dom related content is not visible
if(isVisibleRes === false) {
$(`.swaggerBox`).addClass(`hide`).removeClass(`show`)
} it's in the unreleased code: You should download the code for this file to try it out. Currently this code listens for changes in the redoc_dom subelement. Auto hide .swaggerBox when .fullApiBox is not visible |
I have downloaded the code and tried it. It is not working
|
Use this function to check if function isVisible(element) {
let isVisible = true
let parentElement = element
if(Boolean(parentElement) === false) {
isVisible = false
}
while (parentElement) {
const parentStyle = getComputedStyle(parentElement)
if (
false
|| parentStyle.display === 'none'
|| parentStyle.visibility === 'hidden'
|| parentStyle.opacity === '0' || parentStyle.opacity === '0.0'
) {
isVisible = false
break
}
parentElement = parentElement.offsetParent
}
return isVisible
} Hide swagger-ui if invisible: const isVisibleRes = isVisible(document.querySelector(`.try .fullApiBox`))
// Destroy swagger-ui if redoc_dom related content is not visible
if(isVisibleRes === false) {
$(`.swaggerBox`).addClass(`hide`).removeClass(`show`)
} 2f8b6b9#diff-119d8aa7f4acb36400625fac0dc39bfec0c4c98d897883290d3bfc03a4870ef6R219-R225 |
The redoc-try code is relatively small, I will explain its implementation principle below, hoping to save your time in dealing with problems.
|
isVisible() is working fine, but there is still the white space, |
Thanks, this issue is fixed. https://drive.google.com/file/d/16hOwWZYPodWgmROv3uqULOI8FAvZLSzH/view |
I haven't used redoc-try, just saw that some people needed it. developed it. It looks like it's used embedded in other pages, and doesn't mix well with the virtual dom, and the h5 hash. But due to the limitations of the implementation, these problems are combined and they are a tricky problem. So, I decided to find time to dedicate a similar case to address these issues. I'm currently studying for a driver's license and looking for a job, so it may not be possible for the last two weeks, sorry. |
Thanks a lot for your support. no issues, |
https://drive.google.com/file/d/1pT75UC7SBQL5lgA98cOnyclGOMU5T_6B/view?usp=sharing
Please find the above link for the screen video reference.
The text was updated successfully, but these errors were encountered: