Skip to content

Commit e11e796

Browse files
feat: Upgrade to popper-2 (#1100)
* feat(popper): Ugrade to popper-2 * feat(popper): Use core-js in storybook for docs site * Update package.json * Update package.json * docs(readme): Add polyfill section to readme * feat(popper): Upgrade popper-core to latest
1 parent e4ca9a2 commit e11e796

File tree

9 files changed

+225
-101
lines changed

9 files changed

+225
-101
lines changed

.storybook/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module.exports = {
1515
],
1616

1717
webpackFinal: async(config) => {
18+
config.entry = ['core-js', ...config.entry];
1819
config.module.rules.push({
1920
test: /\.stories\.js?$/,
2021
use: [{ loader: 'story-description-loader' }],

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ See [Component Documentation](https://sap.github.io/fundamental-react/) for exam
2121

2222
You will need to install [Node and Node Package Manager](https://www.npmjs.com/get-npm).
2323

24+
## Polyfills
25+
26+
Fundamental React requires a polyfill for:
27+
- [Object.assign](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
28+
- [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
29+
- [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
30+
31+
You will need to add your own polyfills. See [core-js](https://github.com/zloirock/core-js#commonjs-api) for instructions.
32+
2433
## Getting Started
2534

2635
For an existing react application, follow the steps below:

package-lock.json

Lines changed: 98 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
},
4646
"dependencies": {
4747
"@babel/runtime-corejs3": "^7.10.2",
48+
"@popperjs/core": "^2.4.3",
4849
"chain-function": "^1.0.1",
4950
"classnames": "^2.2.6",
5051
"detect-browser": "^5.1.0",
@@ -55,7 +56,8 @@
5556
"react-foco": "^1.3.0",
5657
"react-focus-lock": "^2.3.1",
5758
"react-overlays": "^2.1.0",
58-
"react-popper": "^1.3.3",
59+
"react-popper": "^2.2.3",
60+
"react-popper-2": "npm:react-popper@^2.2.3",
5961
"shortid": "^2.2.14",
6062
"tabbable": "^4.0.0"
6163
},

src/Popover/Popover.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ class Popover extends Component {
171171
noArrow={noArrow}
172172
onClickOutside={chain(this.handleOutsideClick, onClickOutside)}
173173
onEscapeKey={chain(this.handleEscapeKey, onEscapeKey)}
174-
placementTargetRef={this.controlRef}
175174
popperClassName={popperClassName}
176175
popperPlacement={placement}
177176
popperProps={{ ...popperProps, id }}

0 commit comments

Comments
 (0)