packages/popper/src/utils/getReferenceNode.js
raw| 1 | /** |
| 2 | * Returns the reference node of the reference object, or the reference object itself. |
| 3 | * @method |
| 4 | * @memberof Popper.Utils |
| 5 | * @param {Element|Object} reference - the reference element (the popper will be relative to this) |
| 6 | * @returns {Element} parent |
| 7 | */ |
| 8 | export default function getReferenceNode(reference) { |
| 9 | return reference && reference.referenceNode ? reference.referenceNode : reference; |
| 10 | } |