向下滚动时,React虚拟化列表消失

时间:2019-01-04 16:21:29

标签: reactjs list react-virtualized

当我向下滚动我的React Virtualized List时,行消失了,但是当我使用滚动条时,问题就不存在了。

版本为9.21,下降到9.0,此问题仍在发生。另外,通常存在导致此问题的样式。

<div className={classes.root} >
     <VirtualizedList
      width={345}
      height={300}
      rowCount={this.state.filteredPlaces.length}
      rowHeight={40}
      rowRenderer={({ key, index, isScrolling, isVisible, style }) => {
            const place = this.state.filteredPlaces[index]
            const item = (
                <ListItem 
                    key={place.name + counter} 
                    dense 
                    button 
                    style={{ paddingLeft: place.type == "neighborhood" ? "20px" : "10px", height: "40px" }}>
           <Checkbox
           onChange={() => 
           this.handleChange(place)}
            value={place.name}
             checked={this.state.chosenPlaces.includes(place.name)}
             />
             <ListItemText primary={`${place.displayName}`} />
              </ListItem>
              )
                return (
                   <div key={key} style={style}>
                     {item}
                    </div>
                        )
             }}
          />
        </div>

0 个答案:

没有答案
相关问题