diff --git a/packages/dnb-design-system-portal/gatsby-browser.js b/packages/dnb-design-system-portal/gatsby-browser.js index c9d17c5d8a2..63aa37f016c 100644 --- a/packages/dnb-design-system-portal/gatsby-browser.js +++ b/packages/dnb-design-system-portal/gatsby-browser.js @@ -40,7 +40,8 @@ export const wrapPageElement = pageElement('browser') // scroll to top on route change export const shouldUpdateScroll = () => true -export const onRouteUpdate = ({ prevLocation }) => { +export const onRouteUpdate = ({ location, prevLocation }) => { + // Ensure heading levels are reset before each page SSR starts resetLevels(1) try { diff --git a/packages/dnb-design-system-portal/src/docs/uilib/components/upload/Examples.tsx b/packages/dnb-design-system-portal/src/docs/uilib/components/upload/Examples.tsx index 2c0f26e9f7f..5a9d66f4abb 100644 --- a/packages/dnb-design-system-portal/src/docs/uilib/components/upload/Examples.tsx +++ b/packages/dnb-design-system-portal/src/docs/uilib/components/upload/Examples.tsx @@ -37,7 +37,10 @@ export const UploadPrefilledFileList = () => ( {() => { const Component = () => { const { files, setFiles } = Upload.useUpload('file-list') - console.log('files', files) + + if (files.length) { + console.log('files', files) + } useMockFiles(setFiles, { errorMessage: 'This is no real file!' }) @@ -60,7 +63,10 @@ export const UploadSingleFile = () => ( {() => { const Component = () => { const { files, setFiles } = Upload.useUpload('upload-single-file') - console.log('files', files, setFiles) + + if (files.length) { + console.log('files', files, setFiles) + } return ( ( const { files, setFiles } = Upload.useUpload( 'upload-accepted-formats' ) - console.log('files', files, setFiles) + + if (files.length) { + console.log('files', files, setFiles) + } return (