Skip to content

Commit a46c9c4

Browse files
authored
feat: Use popper for popovers (#467)
* Implemented react-popper for popovers * Removed clickHandler prop to let onClick filter through * Abstracted react-popper functionality to an internal component * Updated jest config to support popper.js and updated Popover tests * Added out-of-boundaries handling and changed popper to default to no portal * Removed default placement * Updated examples * Updated tests and components to match new Popover API * Remove unused code blocks * Updates to Popover component page * Fixed tests for TimePicker and LocalizationEditor * Updated components, tests and snapshots * Updated size limit * Split out popper-based styles into separate scss file
1 parent 683c9c3 commit a46c9c4

34 files changed

+1324
-3817
lines changed

.size-limit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
name: "Fundamental-React Size",
44
webpack: true,
55
path: "lib/index.js",
6-
limit: "40 KB"
6+
limit: "50 KB"
77
}
88
]

__mocks__/popper.js.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import PopperJs from 'popper.js';
2+
3+
export default class Popper {
4+
static placements = PopperJs.placements;
5+
6+
constructor() {
7+
return {
8+
destroy: () => { },
9+
scheduleUpdate: () => { }
10+
};
11+
}
12+
}

config/jest/jest.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@ import { configure } from 'enzyme';
33

44
configure({ adapter: new Adapter() });
55

6+
//https://github.com/FezVrasta/popper.js/issues/478
7+
if (global.document) {
8+
document.createRange = () => ({
9+
setStart: () => { },
10+
setEnd: () => { },
11+
commonAncestorContainer: {
12+
nodeName: 'BODY',
13+
ownerDocument: document
14+
}
15+
});
16+
}
17+
618
module.exports = {
719
'testURL': 'http://localhost/'
820
};

0 commit comments

Comments
 (0)