Skip to content

Commit

Permalink
feat: Use popper for popovers (#467)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
greg-a-smith authored Mar 15, 2019
1 parent 683c9c3 commit a46c9c4
Show file tree
Hide file tree
Showing 34 changed files with 1,324 additions and 3,817 deletions.
2 changes: 1 addition & 1 deletion .size-limit
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
name: "Fundamental-React Size",
webpack: true,
path: "lib/index.js",
limit: "40 KB"
limit: "50 KB"
}
]
12 changes: 12 additions & 0 deletions __mocks__/popper.js.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import PopperJs from 'popper.js';

export default class Popper {
static placements = PopperJs.placements;

constructor() {
return {
destroy: () => { },
scheduleUpdate: () => { }
};
}
}
12 changes: 12 additions & 0 deletions config/jest/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ import { configure } from 'enzyme';

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

//https://github.com/FezVrasta/popper.js/issues/478
if (global.document) {
document.createRange = () => ({
setStart: () => { },
setEnd: () => { },
commonAncestorContainer: {
nodeName: 'BODY',
ownerDocument: document
}
});
}

module.exports = {
'testURL': 'http://localhost/'
};
Loading

0 comments on commit a46c9c4

Please sign in to comment.