Google News
logo
Popper.js - Interview Questions
Attaching elements to the DOM in Popper.js.
The recommended way to use Popper is to attach popper elements next to their reference elements.

This ensures that accessibility best practices are followed, such as keyboard navigation and screen reader support.
 
There are cases where you may want to attach popper elements to the top of the DOM, such as <body />, this is of course supported as well, but some measures should be taken to ensure that everything works in the best possible way.
 
To ensure the best possible performance, it's recommended to not attach elements directly to the <body /> element, but instead create a <div /> element right within the <body /> and use it as container of your poppers.
Advertisement