@remirror/extension-positioner
Reposition your elements with every state update.
Installation
yarn add @remirror/extension-positioner
pnpm add @remirror/extension-positioner
npm install @remirror/extension-positioner
This is included by default when you install the recommended remirror
package. All exports are also available via the entry-point, remirror/extensions
.
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/extensions';
const extension = new PositionerExtension();
const dispose = extension.addCustomHandler({
positioner: 'bubble',
element,
onChange: ({ isActive, top, left }) => {
},
});
dispose();