bug: notification deep-link does not scroll to comment on document detail page #299
@@ -291,6 +291,11 @@ $effect(() => {
|
||||
|
||||
let navHeight = $state(0);
|
||||
|
||||
async function waitForPanelRender(): Promise<void> {
|
||||
await tick();
|
||||
await new Promise<void>((resolve) => requestAnimationFrame(() => resolve()));
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
navHeight = document.querySelector('header')?.getBoundingClientRect().height ?? 0;
|
||||
|
||||
@@ -311,13 +316,10 @@ onMount(() => {
|
||||
setTimeout(() => (flashAnnotationId = null), prefersReducedMotion ? 2000 : 1500);
|
||||
},
|
||||
prefersReducedMotion,
|
||||
afterTick: async () => {
|
||||
await tick();
|
||||
await new Promise<void>((resolve) => requestAnimationFrame(() => resolve()));
|
||||
},
|
||||
afterTick: waitForPanelRender,
|
||||
getElement: (id) => document.getElementById(id),
|
||||
onStripUrl: () => replaceState(page.url.pathname, page.state)
|
||||
});
|
||||
onStripUrl: () => replaceState(page.url.pathname, page.state ?? {})
|
||||
}).catch((e) => console.error('deep-link scroll failed', e));
|
||||
|
||||
function onKeyDown(e: KeyboardEvent) {
|
||||
if (e.key === 'Escape' && transcribeMode) {
|
||||
|
||||
Reference in New Issue
Block a user