@skyscanner/backpack-web 34.7.0 → 34.7.1
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.
|
@@ -93,13 +93,22 @@ const BpkPopover = ({
|
|
|
93
93
|
getFloatingProps,
|
|
94
94
|
getReferenceProps
|
|
95
95
|
} = useInteractions([click, dismiss]);
|
|
96
|
+
const targetClick = target.props.onClick;
|
|
97
|
+
const referenceProps = getReferenceProps({
|
|
98
|
+
onClick: event => {
|
|
99
|
+
if (targetClick) {
|
|
100
|
+
event.stopPropagation();
|
|
101
|
+
targetClick(event);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
});
|
|
96
105
|
const targetElement = /*#__PURE__*/isValidElement(target) ? ( /*#__PURE__*/cloneElement(target, {
|
|
97
|
-
...
|
|
106
|
+
...referenceProps,
|
|
98
107
|
// @ts-ignore - we're adding a popover ref to the target element so we can position the popover relative to it
|
|
99
108
|
ref: refs.setReference
|
|
100
109
|
})) : /*#__PURE__*/_jsx("div", {
|
|
101
110
|
ref: refs.setReference,
|
|
102
|
-
...
|
|
111
|
+
...referenceProps,
|
|
103
112
|
children: target
|
|
104
113
|
});
|
|
105
114
|
const classNames = getClassName('bpk-popover', className);
|