Has anyone successfully used position:sticky with menubar?

I’m trying to create a sticky menubar with prose mirror and tried the CSS position:sticky attribute. I’m having trouble getting the right screen coordinates for nodes when the sticky menu is active (i.e. when the editor element has scrolled).