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
 | 
					  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!
 | 
					    window.setTimeout(() => {
 | 
				
			||||||
 | 
					 | 
				
			||||||
      // Some delay is applied to give Svelte the time to render the _question_
 | 
					      // Some delay is applied to give Svelte the time to render the _question_
 | 
				
			||||||
      window.setTimeout(() => {
 | 
					      Utils.scrollIntoView(<any>htmlElem)
 | 
				
			||||||
        Utils.scrollIntoView(<any>htmlElem)
 | 
					    }, 50)
 | 
				
			||||||
      }, 50)
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const _htmlElement = new UIEventSource<HTMLElement>(undefined)
 | 
					  const _htmlElement = new UIEventSource<HTMLElement>(undefined)
 | 
				
			||||||
| 
						 | 
					@ -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>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue