mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 02:05:45 +03:00
Scroll breadcrumbs to the left when they change
Fixes https://github.com/vector-im/riot-web/issues/9355
This commit is contained in:
parent
37afa9fc0e
commit
04b521c48b
2 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -173,6 +173,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 a new issue