Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-virtualized

Package Overview
Dependencies
Maintainers
1
Versions
296
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-virtualized - npm Package Compare versions

Comparing version 4.8.1 to 4.9.0

docs/usingAutoSizer.md

3

CHANGELOG.md
Changelog
------------
### 4.9.0
`AutoSizer` component now takes padding into consideration before setting the `width` and `height` of its children.
##### 4.8.1

@@ -5,0 +8,0 @@ Updated `InfiniteLoader` to better reflect required properties. (`isRowLoaded`, `rowsCount`, and `threshold` were not marked as required before.)

@@ -18,1 +18,2 @@ Documentation

* [Displaying items in reverse order](reverseList.md).
* [Using AutoSizer](usingAutoSizer.md).

3

package.json

@@ -6,3 +6,3 @@ {

"user": "bvaughn",
"version": "4.8.1",
"version": "4.9.0",
"scripts": {

@@ -67,2 +67,3 @@ "build": "npm run build:css && npm run build:dist && npm run build:demo",

"it",
"getComputedStyle",
"jasmine"

@@ -69,0 +70,0 @@ ]

@@ -65,3 +65,3 @@ /** @flow */

<div className={styles.AutoSizerWrapper}>
<AutoSizer className={styles.AutoSizer}>
<AutoSizer>
<VirtualScroll

@@ -68,0 +68,0 @@ className={styles.VirtualScroll}

@@ -101,5 +101,11 @@ /** @flow */

const style = getComputedStyle(this._parentNode)
const paddingLeft = parseInt(style.paddingLeft, 10)
const paddingRight = parseInt(style.paddingRight, 10)
const paddingTop = parseInt(style.paddingTop, 10)
const paddingBottom = parseInt(style.paddingBottom, 10)
this.setState({
height: height,
width: width
height: height - paddingTop - paddingBottom,
width: width - paddingLeft - paddingRight
})

@@ -106,0 +112,0 @@ }

@@ -33,7 +33,21 @@ import React from 'react'

height = 100,
paddingBottom = 0,
paddingLeft = 0,
paddingRight = 0,
paddingTop = 0,
styleSheet = undefined,
width = 200
} = {}) {
const style = {
boxSizing: 'border-box',
height,
paddingBottom,
paddingLeft,
paddingRight,
paddingTop,
width
}
return (
<div style={{ height, width }}>
<div style={style}>
<AutoSizer

@@ -73,2 +87,14 @@ disableHeight={disableHeight}

it('should account for padding when calculating the available width and height', () => {
const component = renderOrUpdateComponent({
paddingBottom: 10,
paddingLeft: 4,
paddingRight: 4,
paddingTop: 15
})
let domNode = findDOMNode(component)
expect(domNode.textContent).toContain('height:75')
expect(domNode.textContent).toContain('width:192')
})
it('should not update :width if :disableWidth is true', () => {

@@ -75,0 +101,0 @@ const component = renderOrUpdateComponent({ disableWidth: true })

@@ -77,21 +77,19 @@ /** @flow */

<div>
<AutoSizer disableHeight>
<InfiniteLoader
ref='InfiniteLoader'
isRowLoaded={this._isRowLoaded}
loadMoreRows={this._loadMoreRows}
<AutoSizer disableHeight>
<InfiniteLoader
ref='InfiniteLoader'
isRowLoaded={this._isRowLoaded}
loadMoreRows={this._loadMoreRows}
rowsCount={list.size}
>
<VirtualScroll
className={styles.VirtualScroll}
height={200}
rowsCount={list.size}
>
<VirtualScroll
className={styles.VirtualScroll}
height={200}
rowsCount={list.size}
rowHeight={30}
rowRenderer={this._rowRenderer}
scrollToIndex={randomScrollToIndex}
/>
</InfiniteLoader>
</AutoSizer>
</div>
rowHeight={30}
rowRenderer={this._rowRenderer}
scrollToIndex={randomScrollToIndex}
/>
</InfiniteLoader>
</AutoSizer>
</ContentBox>

@@ -98,0 +96,0 @@ )

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc