Primitives / foldkit-primitives/dom
DragPreview
const · packages/primitives/src/dom/drag-preview.ts:16
const DragPreview: Mount.MountDefinitionWithArgs<'DragPreview', {}, never>What a drag carries, shown as an element that follows the pointer, as a Mount.
The view draws the element once while a drag is under way, with popover="manual"
and what it shows; the Mount puts it in the top layer, above every panel and
clear of an ancestor's contain or transform, and the top layer drops it when the
element goes (a drop, a cancel, an unmount).
It moves nothing: PointerDrag writes the pointer's position on the document
root (DRAGGING, in ./pointer-drag), so the element's rule reads var(--fk-drag-x) and the page is
not drawn again per pointer move. A browser without popovers leaves the element
where the page flow puts it.
In the guides
- Pressing and draggingPrimitives / Interaction
- foldkit-primitives/domPrimitives / DOM
- The keyboard and the pointerComposition / foldkit-mixins-builder