mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
fix(content): scrollToTop
This commit is contained in:
@ -167,15 +167,15 @@ export class Content {
|
||||
* Scroll to the top of the component
|
||||
*/
|
||||
@Method()
|
||||
scrollToTop(duration = 100): Promise<void> {
|
||||
return this.scrollToPoint(0, undefined, duration);
|
||||
scrollToTop(duration = 0): Promise<void> {
|
||||
return this.scrollToPoint(undefined, 0, duration);
|
||||
}
|
||||
|
||||
/**
|
||||
* Scroll to the bottom of the component
|
||||
*/
|
||||
@Method()
|
||||
scrollToBottom(duration = 100): Promise<void> {
|
||||
scrollToBottom(duration = 0): Promise<void> {
|
||||
const y = this.scrollEl.scrollHeight - this.scrollEl.clientHeight;
|
||||
return this.scrollToPoint(undefined, y, duration);
|
||||
}
|
||||
|
Reference in New Issue
Block a user