Checks whether an item at a specific index is outside of the viewport.
(index: number, side?: 'start' | 'end')
| 145 | |
| 146 | /** Checks whether an item at a specific index is outside of the viewport. */ |
| 147 | private _isOutOfView(index: number, side?: 'start' | 'end') { |
| 148 | const {offsetWidth, offsetLeft} = this.items()[index].element.nativeElement; |
| 149 | |
| 150 | if ((!side || side === 'start') && offsetLeft - this.position < 0) { |
| 151 | return true; |
| 152 | } |
| 153 | |
| 154 | return ( |
| 155 | (!side || side === 'end') && |
| 156 | offsetWidth + offsetLeft - this.position > this.list().nativeElement.clientWidth |
| 157 | ); |
| 158 | } |
| 159 | } |
no outgoing calls
no test coverage detected