When selecting a toot via keyboard, ensure it is scrolled into view (#10593)
This commit is contained in:
		
							parent
							
								
									05ef3462ba
								
							
						
					
					
						commit
						5121d9c12f
					
				
					 5 changed files with 51 additions and 22 deletions
				
			
		| 
						 | 
				
			
			@ -367,11 +367,16 @@ class UI extends React.PureComponent {
 | 
			
		|||
  handleHotkeyFocusColumn = e => {
 | 
			
		||||
    const index  = (e.key * 1) + 1; // First child is drawer, skip that
 | 
			
		||||
    const column = this.node.querySelector(`.column:nth-child(${index})`);
 | 
			
		||||
    if (!column) return;
 | 
			
		||||
    const container = column.querySelector('.scrollable');
 | 
			
		||||
 | 
			
		||||
    if (column) {
 | 
			
		||||
      const status = column.querySelector('.focusable');
 | 
			
		||||
    if (container) {
 | 
			
		||||
      const status = container.querySelector('.focusable');
 | 
			
		||||
 | 
			
		||||
      if (status) {
 | 
			
		||||
        if (container.scrollTop > status.offsetTop) {
 | 
			
		||||
          status.scrollIntoView(true);
 | 
			
		||||
        }
 | 
			
		||||
        status.focus();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue