Ability to place popper in a specific X, Y position
See original GitHub issueI would like to implement a context menu using popper.js
. I managed to do this using a reference element catching the contextmenu
event. However I am wondering if it is possible to place the popper menu in a specific position.
In the case of a context menu the X and Y position would be given by the right click position.
Something like this:
var reference = document.querySelector('.my-button');
var popper = document.querySelector('.my-popper');
reference.addEventListener('contextmenu',
function (e) {
e.preventDefault();
new Popper(reference, popper, {
position: {
x: e.clientX,
y: e.clientY
}
})
}
)
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How to update the x/y position of a popper.js element?
what I have done here is to move your Popper() into a function called update popper, which will rebuild the popper new each...
Read more >Everything I Know About Positioning Poppers (Tooltips ...
As an initial step, you'll place the popper somewhere next to the reference element somewhere in your UI. To do this, you'll choose...
Read more >Placement option for both popper and target element? #226
Hi guys, I'm considering migrating my project to Popper from Tether (because Popper ... Offset modifier can take x and y offsets, use...
Read more >How to Build a Dynamically Positioned Popover ... - YouTube
The popper.js library is a powerful positioning engine for tooltips and popovers. Today, we are going to harness the power of Popper.js in ......
Read more >Popper (v2.×)
With Popper, you can place your elements anywhere and they will be positioned correctly, without needing to consider different screen sizes, layouts, etc....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For those coming after me, I think I got it to work by doing the following:
@tnrich the interface is described at the bottom: