@remirror/extension-positioner
Reposition your elements with every state update.
Installation
yarn add @remirror/extension-positioner@next @remirror/pm@next
pnpm add @remirror/extension-positioner@next @remirror/pm@next
npm install @remirror/extension-positioner@next @remirror/pm@next
Usage
An extension for tracking the position of the provided element relative to the prosemirror editor.
Can be used to find the top / left position in order to position the element as a hover menu.
import { PositionerExtension } from '@remirror/extension-positioner';
const extension = new PositionerExtension();
const dispose = extension.addCustomHandler({
positioner: 'bubble',
element,
onChange: ({ isActive, top, left }) => {
},
});
dispose();
Credits
This package was bootstrapped with monots.