diff --git a/package.json b/package.json index bae2425..728868f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-redux-popup", - "version": "2.1.0", + "version": "2.1.1", "description": "React redux popup", "main": "lib/react-redux-popup", "scripts": { @@ -8,6 +8,7 @@ "build": "NODE_ENV=production webpack --config ./configs/webpack.config.js --progress --profile --colors", "coverage": "./node_modules/jest/bin/jest.js --coverage", "lint": "eslint src/**", + "prepublishOnly": "npm run clean && rm -rf node_modules && npm cache clean && npm i && npm run build", "start": "node ./example-app/server.js", "test": "./node_modules/jest/bin/jest.js", "test-dev": "./node_modules/jest/bin/jest.js --watch" diff --git a/src/popup.jsx b/src/popup.jsx index c82351a..f0db63a 100644 --- a/src/popup.jsx +++ b/src/popup.jsx @@ -52,11 +52,12 @@ export const HOCPopup = ComposedComponent => { } setPopupPosition() { + const popupRect = this.popup.getBoundingClientRect(); const style = getPopupPosition( this.props.anchor, this.props.getRect(), - this.popup.clientWidth, - this.popup.clientHeight, + popupRect.width, + popupRect.height, window.innerWidth, window.innerHeight, this.props.offset);