@primer/react 0.0.0-20260701222756 → 0.0.0-20260701230315
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/dist/TooltipV2/Tooltip.js +4 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -75,11 +75,14 @@ const delayTimeMap = {
|
|
|
75
75
|
const isInteractive = (element) => {
|
|
76
76
|
return interactiveElements.some((selector) => element.matches(selector)) || element.hasAttribute("role") && element.getAttribute("role") === "button";
|
|
77
77
|
};
|
|
78
|
+
function getChildRef(element) {
|
|
79
|
+
return "ref" in element ? element.ref : void 0;
|
|
80
|
+
}
|
|
78
81
|
const emptyKeybindingHints = [];
|
|
79
82
|
const Tooltip = /*#__PURE__*/ React.forwardRef(({ direction = "s", text, type = "description", children, id, className, keybindingHint = emptyKeybindingHints, delay = "short", _privateDisableTooltip = false, ...rest }, forwardedRef) => {
|
|
80
83
|
const tooltipId = useId$1(id);
|
|
81
84
|
const child = Children.only(children);
|
|
82
|
-
const childRef = child
|
|
85
|
+
const childRef = /*#__PURE__*/ React.isValidElement(child) ? getChildRef(child) : void 0;
|
|
83
86
|
const triggerRef = useRef(null);
|
|
84
87
|
const tooltipElRef = React.useRef(null);
|
|
85
88
|
const assignRef = (ref, node) => {
|
package/package.json
CHANGED