forked from MapComplete/MapComplete
Tone down scrolling behaviour after user test
This commit is contained in:
parent
86490643b6
commit
d62974b1e3
1 changed files with 7 additions and 12 deletions
|
@ -48,16 +48,13 @@
|
|||
}
|
||||
|
||||
let htmlElem: HTMLDivElement
|
||||
$: {
|
||||
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
|
||||
// Make sure that the question is in the scrollview!
|
||||
|
||||
function enableEditMode(){
|
||||
// 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!
|
||||
window.setTimeout(() => {
|
||||
// Some delay is applied to give Svelte the time to render the _question_
|
||||
window.setTimeout(() => {
|
||||
Utils.scrollIntoView(<any>htmlElem)
|
||||
}, 50)
|
||||
}
|
||||
Utils.scrollIntoView(<any>htmlElem)
|
||||
}, 50)
|
||||
}
|
||||
|
||||
const _htmlElement = new UIEventSource<HTMLElement>(undefined)
|
||||
|
@ -132,9 +129,7 @@
|
|||
<EditButton
|
||||
arialabel={config.editButtonAriaLabel}
|
||||
ariaLabelledBy={answerId}
|
||||
on:click={() => {
|
||||
editMode = true
|
||||
}}
|
||||
on:click={() => enableEditMode()}
|
||||
/>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue