Pages are interactive one by one, so NavigateTo and menu links run an enhanced navigation that re-renders the page on the server and syncs <head>. That broke the editor in three ways: - Switching files navigated to ?file=...: the editor kept the old file, and with the large Transactions.json its DOM got mangled. The file is now loaded in place and only the URL is replaced (js/url.js). - Leaving the page re-ran OnParametersSetAsync on the disposing editor, which threw and terminated the circuit. The file parameter is now only read in OnInitializedAsync. - Coming back without a full reload showed Monaco unstyled, because its stylesheets had been removed from <head>. monaco.js now remembers them and puts them back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 lines
417 B
JavaScript
8 lines
417 B
JavaScript
// Changes the address bar without navigating. Pages are interactive one by one, so
|
|
// NavigationManager.NavigateTo runs an enhanced navigation (the page is rendered again on the
|
|
// server and merged into the DOM), which the JSON editor can't survive.
|
|
|
|
/** Replaces the current history entry's URL, keeping Blazor's history state. */
|
|
export function replace(url) {
|
|
history.replaceState(history.state, '', url);
|
|
}
|