fix thread auto scroll

This commit is contained in:
Nicolas Constant 2019-10-07 23:46:03 -04:00
parent 0fe3cbce62
commit f9bf362935
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 6 additions and 5 deletions

View File

@ -9,6 +9,7 @@ import { NotificationService, NewReplyData } from '../../../services/notificatio
import { AccountInfo } from '../../../states/accounts.state';
import { StatusWrapper } from '../../../models/common.model';
import { StatusComponent } from '../status/status.component';
import scrollIntoView from 'scroll-into-view-if-needed';
@Component({
selector: 'app-thread',
@ -177,11 +178,11 @@ export class ThreadComponent implements OnInit, OnDestroy {
setTimeout(() => {
const el = this.statusChildren.toArray()[position];
el.isSelected = true;
// el.elem.nativeElement.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'start' });
// el.elem.nativeElement.scrollIntoView({ behavior: 'auto', block: 'start', inline: 'nearest' });
// el.elem.nativeElement.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'start' });
el.elem.nativeElement.scrollIntoViewIfNeeded({ behavior: 'auto', block: 'start', inline: 'nearest' });
}, 0);
//el.elem.nativeElement.scrollIntoViewIfNeeded({ behavior: 'auto', block: 'start', inline: 'nearest' });
scrollIntoView(el.elem.nativeElement, { behavior: 'smooth', block: 'nearest'});
}, 250);
})
.catch((err: HttpErrorResponse) => {
this.notificationService.notifyHttpError(err, currentAccount);