UNPKG

@material-ui/popper.js

Version:

A fork of popper.js to avoid the deprecation warnings: https://github.com/mui-org/material-ui/issues/19358.

12 lines (11 loc) 382 B
/** * Get the opposite placement of the given one * @method * @memberof Popper.Utils * @argument {String} placement * @returns {String} flipped placement */ export default function getOppositePlacement(placement) { const hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; return placement.replace(/left|right|bottom|top/g, matched => hash[matched]); }