(this: HTMLElement, options: ScrollToOptions)
| 57 | Object.defineProperty(HTMLElement.prototype, 'scrollTo', { |
| 58 | configurable: true, |
| 59 | value(this: HTMLElement, options: ScrollToOptions) { |
| 60 | const next = Math.max( |
| 61 | 0, |
| 62 | Math.min(options.top ?? 0, this.scrollHeight - this.clientHeight), |
| 63 | ) |
| 64 | if (next !== this.scrollTop) { |
| 65 | this.scrollTop = next |
| 66 | this.dispatchEvent(new Event('scroll')) |
| 67 | } |
| 68 | }, |
| 69 | }) |
| 70 | }) |
| 71 |
no outgoing calls
no test coverage detected