prevent updating cursor position if not necessary
This commit is contained in:
		
							parent
							
								
									26a323733d
								
							
						
					
					
						commit
						377df18788
					
				@ -46,19 +46,27 @@ export function afterTransactionSelectionFixer (y, transaction, remote) {
 | 
				
			|||||||
  if (from !== null) {
 | 
					  if (from !== null) {
 | 
				
			||||||
    let sel = fromRelativePosition(fromY, from)
 | 
					    let sel = fromRelativePosition(fromY, from)
 | 
				
			||||||
    if (sel !== null) {
 | 
					    if (sel !== null) {
 | 
				
			||||||
 | 
					      let node = sel.type.getDom()
 | 
				
			||||||
 | 
					      let offset = sel.offset
 | 
				
			||||||
 | 
					      if (node !== anchorNode || offset !== anchorOffset) {
 | 
				
			||||||
 | 
					        anchorNode = node
 | 
				
			||||||
 | 
					        anchorOffset = offset
 | 
				
			||||||
        shouldUpdate = true
 | 
					        shouldUpdate = true
 | 
				
			||||||
      anchorNode = sel.type.getDom()
 | 
					      }
 | 
				
			||||||
      anchorOffset = sel.offset
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  if (to !== null) {
 | 
					  if (to !== null) {
 | 
				
			||||||
    let sel = fromRelativePosition(toY, to)
 | 
					    let sel = fromRelativePosition(toY, to)
 | 
				
			||||||
    if (sel !== null) {
 | 
					    if (sel !== null) {
 | 
				
			||||||
      focusNode = sel.type.getDom()
 | 
					      let node = sel.type.getDom()
 | 
				
			||||||
      focusOffset = sel.offset
 | 
					      let offset = sel.offset
 | 
				
			||||||
 | 
					      if (node !== focusNode || offset !== focusOffset) {
 | 
				
			||||||
 | 
					        focusNode = node
 | 
				
			||||||
 | 
					        focusOffset = offset
 | 
				
			||||||
        shouldUpdate = true
 | 
					        shouldUpdate = true
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  if (shouldUpdate) {
 | 
					  if (shouldUpdate) {
 | 
				
			||||||
    browserSelection.setBaseAndExtent(
 | 
					    browserSelection.setBaseAndExtent(
 | 
				
			||||||
      anchorNode,
 | 
					      anchorNode,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user