diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..26408a80 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,13 @@ +--- +plugins: + - "react" +env: { + es6: true +} +ecmaFeatures: { + modules: true, + jsx: true +} +rules: + valid-jsdoc: [2, { "requireReturn": false }] + 'react/jsx-uses-react': [1] diff --git a/package.json b/package.json index 520a60ae..8c00a45b 100644 --- a/package.json +++ b/package.json @@ -63,52 +63,6 @@ "react": "^0.14.2", "xunit-file": "~0.0.9" }, - "eslintConfig": { - "rules": { - "space-before-function-paren": 2, - "valid-jsdoc": [ - 2, - { - "requireReturn": false, - "requireReturnDescription": false - } - ], - "no-else-return": 2, - "no-extra-bind": 2, - "no-multi-spaces": 2, - "no-useless-call": 2, - "radix": 2, - "handle-callback-err": [ - 2, - "^(err|error)$" - ], - "array-bracket-spacing": 2, - "block-spacing": 2, - "comma-spacing": 2, - "jsx-quotes": [ - 2, - "prefer-single" - ], - "no-multiple-empty-lines": 2, - "no-trailing-spaces": 2, - "sort-vars": 2, - "space-after-keywords": 2, - "space-before-blocks": 2, - "space-infix-ops": 2, - "space-return-throw-case": 2, - "wrap-regex": 2, - "new-cap": 0 - }, - "plugins": [ - "react" - ], - "ecmaFeatures": { - "jsx": true - }, - "env": { - "es6": true - } - }, "peerDependencies": { "react": "^0.14.2", "react-dom": "^0.14.2" diff --git a/src/Sticky.jsx b/src/Sticky.jsx index 4b25f4c1..4f79714d 100644 --- a/src/Sticky.jsx +++ b/src/Sticky.jsx @@ -149,7 +149,7 @@ class Sticky extends Component { var outerRect = outer.getBoundingClientRect(); var innerRect = inner.getBoundingClientRect(); - var width = innerRect.width || innerRect.right - innerRect.left; + var width = outerRect.width || outerRect.right - outerRect.left; var height = innerRect.height || innerRect.bottom - innerRect.top;; var outerY = outerRect.top + scrollTop;