Fix scrolling issues when closing some dropdown menus (#14606)
This commit is contained in:
		
					parent
					
						
							
								9b2648b30a
							
						
					
				
			
			
				commit
				
					
						c7cfd4e67a
					
				
			
		
					 2 changed files with 3 additions and 3 deletions
				
			
		|  | @ -179,7 +179,7 @@ class PrivacyDropdown extends React.PureComponent { | |||
|     } else { | ||||
|       const { top } = target.getBoundingClientRect(); | ||||
|       if (this.state.open && this.activeElement) { | ||||
|         this.activeElement.focus(); | ||||
|         this.activeElement.focus({ preventScroll: true }); | ||||
|       } | ||||
|       this.setState({ placement: top * 2 < innerHeight ? 'bottom' : 'top' }); | ||||
|       this.setState({ open: !this.state.open }); | ||||
|  | @ -220,7 +220,7 @@ class PrivacyDropdown extends React.PureComponent { | |||
| 
 | ||||
|   handleClose = () => { | ||||
|     if (this.state.open && this.activeElement) { | ||||
|       this.activeElement.focus(); | ||||
|       this.activeElement.focus({ preventScroll: true }); | ||||
|     } | ||||
|     this.setState({ open: false }); | ||||
|   } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue