@react-native-aria/overlays 0.3.5 → 0.3.7
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/lib/commonjs/web/overlays/src/calculatePosition.js +53 -16
- package/lib/commonjs/web/overlays/src/calculatePosition.js.map +1 -1
- package/lib/commonjs/web/overlays/src/useCloseOnScroll.js.map +1 -1
- package/lib/commonjs/web/overlays/src/useOverlayPosition.js +21 -1
- package/lib/commonjs/web/overlays/src/useOverlayPosition.js.map +1 -1
- package/lib/module/web/overlays/src/calculatePosition.js +52 -16
- package/lib/module/web/overlays/src/calculatePosition.js.map +1 -1
- package/lib/module/web/overlays/src/useCloseOnScroll.js.map +1 -1
- package/lib/module/web/overlays/src/useOverlayPosition.js +21 -1
- package/lib/module/web/overlays/src/useOverlayPosition.js.map +1 -1
- package/package.json +1 -1
- package/src/web/overlays/src/calculatePosition.ts +227 -85
- package/src/web/overlays/src/useCloseOnScroll.ts +5 -5
- package/src/web/overlays/src/useOverlayPosition.ts +24 -1
- package/yarn-error.log +0 -10007
@@ -109,7 +109,7 @@ export function useOverlayPosition(props: AriaPositionProps): PositionAria {
|
|
109
109
|
crossOffset,
|
110
110
|
isOpen,
|
111
111
|
direction,
|
112
|
-
shouldOverlapWithTrigger
|
112
|
+
shouldOverlapWithTrigger,
|
113
113
|
];
|
114
114
|
|
115
115
|
let updatePosition = useCallback(() => {
|
@@ -183,6 +183,29 @@ export function useOverlayPosition(props: AriaPositionProps): PositionAria {
|
|
183
183
|
onClose: onClose ? close : undefined,
|
184
184
|
});
|
185
185
|
|
186
|
+
// useLayoutEffect(() => {
|
187
|
+
// const mutationObserver = new MutationObserver((mutations) => {
|
188
|
+
// updatePosition();
|
189
|
+
// mutations.forEach((mutation) => {
|
190
|
+
// // if (mutation.attributeName === 'style') {
|
191
|
+
// // const transform = mutation.target.style.transform;
|
192
|
+
// // if (transform) {
|
193
|
+
// // const match = transform.match(/scale\((.+)\)/);
|
194
|
+
// // if (match) {
|
195
|
+
// // const scale = parseFloat(match[1]);
|
196
|
+
// // console.log(`Scale: ${scale}`);
|
197
|
+
// // // updatePosition();
|
198
|
+
// // }
|
199
|
+
// // }
|
200
|
+
// // }
|
201
|
+
// });
|
202
|
+
// });
|
203
|
+
|
204
|
+
// mutationObserver.observe(overlayRef?.current, { attributes: true });
|
205
|
+
|
206
|
+
// return () => mutationObserver.disconnect();
|
207
|
+
// }, [overlayRef, updatePosition]);
|
208
|
+
|
186
209
|
return {
|
187
210
|
rendered: true,
|
188
211
|
overlayProps: {
|