Skip to content

Commit

Permalink
Fix scroll bug, fix vulnerabilities (#578)
Browse files Browse the repository at this point in the history
* fix scroll issue, tx and ty need to be an array, update vulnerable deps and react version
* remove console.log
  • Loading branch information
sarmeyer authored Sep 3, 2019
1 parent 494a35c commit b21de80
Show file tree
Hide file tree
Showing 5 changed files with 784 additions and 567 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- [#572](https://github.com/FormidableLabs/nuka-carousel/pull/572) Fix Travis configuration
- [#571](https://github.com/FormidableLabs/nuka-carousel/pull/571) Next and Previous buttons should not be submit type buttons
- [#565](https://github.com/FormidableLabs/nuka-carousel/pull/565) Add missing controls to the TypeScript library definition
- [#564](https://github.com/FormidableLabs/nuka-carousel/pull/564) Export NextButton, PreviousButton, PagingDots from main entrypoint to allow for easier style targeting
- [#564](https://github.com/FormidableLabs/nuka-carousel/pull/564) Export NextButton, PreviousButton, PagingDots from main entry point to allow for easier style targeting
- [#562](https://github.com/FormidableLabs/nuka-carousel/pull/562) Allow isEdgeSwiping to work with vertical slider
- [#561](https://github.com/FormidableLabs/nuka-carousel/pull/561) Avoid the empty div wrapper for null custom controls

Expand Down
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@
"jsnext:main": "es/index.js",
"types": "index.d.ts",
"dependencies": {
"csstype": "^2.6.3",
"csstype": "^2.6.6",
"d3-ease": "^1.0.3",
"exenv": "^1.2.0",
"prop-types": "^15.6.0",
"react-move": "^5.0.0"
},
"devDependencies": {
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-object-rest-spread": "^7.4.3",
"@babel/cli": "^7.5.5",
"@babel/core": "^7.5.5",
"@babel/plugin-proposal-object-rest-spread": "^7.5.5",
"@babel/plugin-transform-object-assign": "^7.2.0",
"@babel/plugin-transform-runtime": "^7.4.3",
"@babel/polyfill": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.5.5",
"@babel/polyfill": "^7.4.4",
"@babel/preset-env": "^7.5.5",
"@babel/preset-react": "^7.0.0",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^8.2.2",
"babel-jest": "^24.7.1",
"babel-loader": "8.0.0-beta.2",
"babel-loader": "8.0.6",
"builder": "^4.0.0",
"chai": "^3.3.0",
"css-loader": "^0.28.10",
Expand All @@ -39,26 +39,26 @@
"eslint-loader": "^2.0.0",
"eslint-plugin-babel": "^4.1.2",
"eslint-plugin-filenames": "^1.2.0",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-react": "^7.4.0",
"eslint-plugin-react": "^7.14.3",
"jest": "^24.7.1",
"jest-environment-enzyme": "^7.0.2",
"jest-enzyme": "^7.0.2",
"jest-puppeteer-preset": "^2.0.1",
"jsdom": "^14.0.0",
"prettier": "1.15.3",
"prettier": "1.18.2",
"puppeteer": "^1.1.1",
"react": "^16.0.0",
"react": "^16.9.0",
"react-dom": "^16.0.0",
"react-hot-loader": "^1.3.0",
"react-test-renderer": "^16.2.0",
"sinon": "^4.4.2",
"style-loader": "^0.20.2",
"tslint": "^5.12.0",
"typescript": "^3.4.1",
"typescript": "^3.6.2",
"url-loader": "^0.6.2",
"webpack": "4.19.1",
"webpack": "4.39.3",
"webpack-cli": "3.1.1",
"webpack-dev-server": "^3.0.0"
},
Expand Down
5 changes: 2 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,15 +631,14 @@ export default class Carousel extends React.Component {
}

return {
tx: this.props.vertical ? 0 : offset,
ty: this.props.vertical ? offset : 0
tx: [this.props.vertical ? 0 : offset],
ty: [this.props.vertical ? offset : 0]
};
}

isEdgeSwiping() {
const { slideCount, slideWidth, slideHeight, slidesToShow } = this.state;
const { tx, ty } = this.getOffsetDeltas();

if (this.props.vertical) {
const rowHeight = slideHeight / slidesToShow;
const slidesLeftToShow = slideCount - slidesToShow;
Expand Down
1 change: 1 addition & 0 deletions src/transitions/scroll-transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export default class ScrollTransition extends React.Component {

getListStyles(styles) {
const { deltaX, deltaY } = styles;

const listWidth =
this.props.slideWidth * React.Children.count(this.props.children);
const spacingOffset =
Expand Down
Loading

0 comments on commit b21de80

Please sign in to comment.