Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
referenceNode can be specified to better facilitate non-fixed positioning when a popper's reference is a "reference object". In particular, reference objects can now return coordinates in "client-space" (i.e. getBoundingClientRect) and popper will calculate positioning using the specified referenceNode rather then falling back to the documentElement. Consequently, enabling Popper.enableEventListeners() will now work as expected, automatically updating the popper position, when scrolling and resizing the browser window; assuming a referenceNode has been provided.
- Loading branch information
1 parent
9f1d603
commit 56b26da
Showing
6 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* Returns the reference node of the reference object, or the reference object itself. | ||
* @method | ||
* @memberof Popper.Utils | ||
* @param {Element|Object} reference - the reference element (the popper will be relative to this) | ||
* @returns {Element} parent | ||
*/ | ||
export default function getReferenceNode(reference) { | ||
return reference && reference.referenceNode ? reference.referenceNode : reference; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters