mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 03:35:51 +00:00
Fix interactive tutorials issues
This commit is contained in:
@@ -31,7 +31,8 @@ export function InteractiveBlock(props: { children: React.ReactNode; label: stri
|
||||
const { pathname } = useLocation();
|
||||
|
||||
return (
|
||||
<div className="interactive-block" id={'interactive-' + stepId}>
|
||||
// add key={pathname} to ensure old step state gets rerendered on page navigation
|
||||
<div className="interactive-block" id={'interactive-' + stepId} key={pathname}>
|
||||
<div className="interactive-block-inner">
|
||||
<div className="breadcrumbs-wrap">
|
||||
<ul
|
||||
@@ -53,7 +54,8 @@ export function InteractiveBlock(props: { children: React.ReactNode; label: stri
|
||||
})}
|
||||
</ul>
|
||||
</div>
|
||||
<div className="interactive-block-ui" key={pathname}>{dynamicReact(props.children, React, {})}</div>
|
||||
|
||||
<div className="interactive-block-ui">{dynamicReact(props.children, React, {})}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -629,6 +629,9 @@ async function show_log(block, msg) {
|
||||
block.find(".output-area").append(msg)
|
||||
}
|
||||
|
||||
/**
|
||||
* Run callback only when the current route is loaded.
|
||||
*/
|
||||
function onCurrentRouteLoaded(callback) {
|
||||
const currentPath = window.location.pathname;
|
||||
window.onRouteChange(() => {
|
||||
|
||||
Reference in New Issue
Block a user