소스 검색

fixed scrolling to anchor tag

Rodja Trappe 2 년 전
부모
커밋
db831c038f
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      api_docs_and_examples.py

+ 3 - 0
api_docs_and_examples.py

@@ -665,3 +665,6 @@ The asynchronous function will only return after receiving the result.
 
         ui.button('run JavaScript', on_click=run_javascript)
         ui.button('await JavaScript', on_click=await_javascript)
+
+    # NOTE because the docs are added after inital page load, we need to manually trigger the jump tho the anchor
+    await ui.run_javascript('parts = document.URL.split("#"); window.location.hash = "#"; setTimeout(function(){ window.location.hash = "#" + (parts.length > 1) ? parts[1] : null; }, 100);')