mirror of https://github.com/vector-im/riot-web
				
				
				
			Merge pull request #2878 from matrix-org/travis/breadcrumbs/auto-scroll-left
Scroll breadcrumbs to the left when they changepull/21833/head
						commit
						2f8c0cb4e9
					
				| 
						 | 
				
			
			@ -40,6 +40,13 @@ export default class IndicatorScrollbar extends React.Component {
 | 
			
		|||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    moveToOrigin() {
 | 
			
		||||
        if (!this._scrollElement) return;
 | 
			
		||||
 | 
			
		||||
        this._scrollElement.scrollLeft = 0;
 | 
			
		||||
        this._scrollElement.scrollTop = 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    _collectScroller(scroller) {
 | 
			
		||||
        if (scroller && !this._scrollElement) {
 | 
			
		||||
            this._scrollElement = scroller;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -189,6 +189,10 @@ export default class RoomBreadcrumbs extends React.Component {
 | 
			
		|||
            rooms.splice(MAX_ROOMS, rooms.length - MAX_ROOMS);
 | 
			
		||||
        }
 | 
			
		||||
        this.setState({rooms});
 | 
			
		||||
 | 
			
		||||
        if (this.refs.scroller) {
 | 
			
		||||
            this.refs.scroller.moveToOrigin();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    _viewRoom(room) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue