fix thread auto scroll
This commit is contained in:
parent
0fe3cbce62
commit
f9bf362935
|
@ -9,6 +9,7 @@ import { NotificationService, NewReplyData } from '../../../services/notificatio
|
||||||
import { AccountInfo } from '../../../states/accounts.state';
|
import { AccountInfo } from '../../../states/accounts.state';
|
||||||
import { StatusWrapper } from '../../../models/common.model';
|
import { StatusWrapper } from '../../../models/common.model';
|
||||||
import { StatusComponent } from '../status/status.component';
|
import { StatusComponent } from '../status/status.component';
|
||||||
|
import scrollIntoView from 'scroll-into-view-if-needed';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-thread',
|
selector: 'app-thread',
|
||||||
|
@ -177,11 +178,11 @@ export class ThreadComponent implements OnInit, OnDestroy {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const el = this.statusChildren.toArray()[position];
|
const el = this.statusChildren.toArray()[position];
|
||||||
el.isSelected = true;
|
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.scrollIntoViewIfNeeded({ 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' });
|
scrollIntoView(el.elem.nativeElement, { behavior: 'smooth', block: 'nearest'});
|
||||||
}, 0);
|
}, 250);
|
||||||
})
|
})
|
||||||
.catch((err: HttpErrorResponse) => {
|
.catch((err: HttpErrorResponse) => {
|
||||||
this.notificationService.notifyHttpError(err, currentAccount);
|
this.notificationService.notifyHttpError(err, currentAccount);
|
||||||
|
|
Loading…
Reference in New Issue