You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
706 B

2 months ago
  1. import computeOffsets from "../utils/computeOffsets.js";
  2. function popperOffsets(_ref) {
  3. var state = _ref.state,
  4. name = _ref.name;
  5. // Offsets are the actual position the popper needs to have to be
  6. // properly positioned near its reference element
  7. // This is the most basic placement, and will be adjusted by
  8. // the modifiers in the next step
  9. state.modifiersData[name] = computeOffsets({
  10. reference: state.rects.reference,
  11. element: state.rects.popper,
  12. strategy: 'absolute',
  13. placement: state.placement
  14. });
  15. } // eslint-disable-next-line import/no-unused-modules
  16. export default {
  17. name: 'popperOffsets',
  18. enabled: true,
  19. phase: 'read',
  20. fn: popperOffsets,
  21. data: {}
  22. };