Tone down scrolling behaviour after user test

This commit is contained in:
Pieter Vander Vennet 2024-09-11 17:36:08 +02:00
parent 86490643b6
commit d62974b1e3

View file

@ -48,17 +48,14 @@
} }
let htmlElem: HTMLDivElement let htmlElem: HTMLDivElement
$: { function enableEditMode(){
if (editMode && htmlElem !== undefined && config.IsKnown($tags)) {
// EditMode switched to true yet the answer is already known, so the person wants to make a change // EditMode switched to true yet the answer is already known, so the person wants to make a change
// Make sure that the question is in the scrollview! // Make sure that the question is in the scrollview!
// Some delay is applied to give Svelte the time to render the _question_
window.setTimeout(() => { window.setTimeout(() => {
// Some delay is applied to give Svelte the time to render the _question_
Utils.scrollIntoView(<any>htmlElem) Utils.scrollIntoView(<any>htmlElem)
}, 50) }, 50)
} }
}
const _htmlElement = new UIEventSource<HTMLElement>(undefined) const _htmlElement = new UIEventSource<HTMLElement>(undefined)
$: _htmlElement.setData(htmlElem) $: _htmlElement.setData(htmlElem)
@ -132,9 +129,7 @@
<EditButton <EditButton
arialabel={config.editButtonAriaLabel} arialabel={config.editButtonAriaLabel}
ariaLabelledBy={answerId} ariaLabelledBy={answerId}
on:click={() => { on:click={() => enableEditMode()}
editMode = true
}}
/> />
{/if} {/if}
</div> </div>