Skip to content

Commit c9870b2

Browse files
S-t-e-p-smartijnrusschen
authored andcommitted
Remove hardcoded popper placement and get them from popper library (Hacker0x01#1559)
1 parent ba93663 commit c9870b2

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

src/popper_component.jsx

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
11
import classnames from "classnames";
22
import React from "react";
33
import PropTypes from "prop-types";
4-
import { Manager, Reference, Popper } from "react-popper";
4+
import { Manager, Reference, Popper, placements } from "react-popper";
55

6-
export const popperPlacementPositions = [
7-
"bottom",
8-
"bottom-end",
9-
"bottom-start",
10-
"left",
11-
"left-end",
12-
"left-start",
13-
"right",
14-
"right-end",
15-
"right-start",
16-
"top",
17-
"top-end",
18-
"top-start"
19-
];
6+
export const popperPlacementPositions = placements;
207

218
export default class PopperComponent extends React.Component {
229
static propTypes = {

0 commit comments

Comments
 (0)