(keys: readonly string[])
| 751 | } |
| 752 | |
| 753 | removeItems(keys: readonly string[]): boolean { |
| 754 | const nextEntries = this.buildEntriesAfterRemoval(keys); |
| 755 | if (!nextEntries) { |
| 756 | return false; |
| 757 | } |
| 758 | |
| 759 | const currentScrollTop = this.scrollContainer.scrollTop; |
| 760 | for (const key of keys) { |
| 761 | const element = this.renderedElements.get(key); |
| 762 | if (element) { |
| 763 | if (this.resizeObserver) { |
| 764 | this.resizeObserver.unobserve(element); |
| 765 | } |
| 766 | element.remove(); |
| 767 | this.renderedElements.delete(key); |
| 768 | } |
| 769 | this.invalidatedKeys.delete(key); |
| 770 | } |
| 771 | |
| 772 | this.applyItemEntries(nextEntries); |
| 773 | this.scrollContainer.scrollTop = currentScrollTop; |
| 774 | this.forceVisibleRangeUpdate(); |
| 775 | return true; |
| 776 | } |
| 777 | |
| 778 | canInsertItems(options: VirtualScrollerInsertOptions<T>): boolean { |
| 779 | return this.buildEntriesAfterInsertion(options) !== null; |
no test coverage detected