Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Fix the type for this.refs.items.children
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jan 7, 2021
1 parent 414607f commit 3c11348
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/select-list-view.ts
Expand Up @@ -71,9 +71,9 @@ module.exports = class SelectListView {
this.visibilityObserver = new IntersectionObserver(changes => {
for (const change of changes) {
if (change.intersectionRatio > 0) {
const element = change.target
const element = change.target as EtchElement
this.visibilityObserver.unobserve(element)
const index = Array.from(this.refs.items.children).indexOf(element)
const index = Array.from(this.refs.items.children as EtchElement[]).indexOf(element)
if (index >= 0) {
this.renderItemAtIndex(index)
}
Expand Down Expand Up @@ -230,7 +230,7 @@ module.exports = class SelectListView {

if (this.visibilityObserver) {
etch.getScheduler().updateDocument(() => {
Array.from(this.refs.items.children).slice(this.props.initiallyVisibleItemCount).forEach((element: any) => {
Array.from(this.refs.items.children as EtchElement[]).slice(this.props.initiallyVisibleItemCount).forEach((element) => {
this.visibilityObserver.observe(element)
})
})
Expand Down

0 comments on commit 3c11348

Please sign in to comment.