(this: HTMLElement, options: ScrollToOptions)
| 43 | Object.defineProperty(HTMLElement.prototype, 'scrollTo', { |
| 44 | configurable: true, |
| 45 | value(this: HTMLElement, options: ScrollToOptions) { |
| 46 | const next = Math.max( |
| 47 | 0, |
| 48 | Math.min(options.top ?? 0, this.scrollHeight - this.clientHeight), |
| 49 | ) |
| 50 | if (next !== this.scrollTop) { |
| 51 | this.scrollTop = next |
| 52 | this.dispatchEvent(new Event('scroll')) |
| 53 | } |
| 54 | }, |
| 55 | }) |
| 56 | }) |
| 57 |
no outgoing calls
no test coverage detected