Skip to content

obsidian/components/pointer-position-component

Remembers where the last pointer gesture happened, so UI can be anchored there.

A context menu is the reason this exists: Obsidian’s file-menu / url-menu events carry the target file or url but no event and no DOM element, and by the time a menu item’s callback runs the menu is closing — so there is nothing left to measure. The right-click (or long-press) that raised the menu is, however, exactly where the user is looking, and it always precedes the menu.

ClassDescription
PointerPositionComponentRecords the position of the last pointer gesture in any window.