@react-aria/interactions 3.0.0-nightly.2541 → 3.0.0-nightly.2555
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/dist/import.mjs +14 -12
- package/dist/main.js +14 -12
- package/dist/main.js.map +1 -1
- package/dist/module.js +14 -12
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/useInteractOutside.ts +16 -13
package/dist/import.mjs
CHANGED
|
@@ -1289,6 +1289,8 @@ function $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {
|
|
|
1289
1289
|
(0, $bx7SL$useEffect)(()=>{
|
|
1290
1290
|
let state = stateRef.current;
|
|
1291
1291
|
if (isDisabled) return;
|
|
1292
|
+
const element = ref.current;
|
|
1293
|
+
const documentObject = (0, $bx7SL$getOwnerDocument)(element);
|
|
1292
1294
|
// Use pointer events if available. Otherwise, fall back to mouse and touch events.
|
|
1293
1295
|
if (typeof PointerEvent !== "undefined") {
|
|
1294
1296
|
let onPointerUp = (e)=>{
|
|
@@ -1296,11 +1298,11 @@ function $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {
|
|
|
1296
1298
|
state.isPointerDown = false;
|
|
1297
1299
|
};
|
|
1298
1300
|
// changing these to capture phase fixed combobox
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
+
documentObject.addEventListener("pointerdown", onPointerDown, true);
|
|
1302
|
+
documentObject.addEventListener("pointerup", onPointerUp, true);
|
|
1301
1303
|
return ()=>{
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
+
documentObject.removeEventListener("pointerdown", onPointerDown, true);
|
|
1305
|
+
documentObject.removeEventListener("pointerup", onPointerUp, true);
|
|
1304
1306
|
};
|
|
1305
1307
|
} else {
|
|
1306
1308
|
let onMouseUp = (e)=>{
|
|
@@ -1313,15 +1315,15 @@ function $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {
|
|
|
1313
1315
|
if (state.isPointerDown && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref)) triggerInteractOutside(e);
|
|
1314
1316
|
state.isPointerDown = false;
|
|
1315
1317
|
};
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1318
|
+
documentObject.addEventListener("mousedown", onPointerDown, true);
|
|
1319
|
+
documentObject.addEventListener("mouseup", onMouseUp, true);
|
|
1320
|
+
documentObject.addEventListener("touchstart", onPointerDown, true);
|
|
1321
|
+
documentObject.addEventListener("touchend", onTouchEnd, true);
|
|
1320
1322
|
return ()=>{
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1323
|
+
documentObject.removeEventListener("mousedown", onPointerDown, true);
|
|
1324
|
+
documentObject.removeEventListener("mouseup", onMouseUp, true);
|
|
1325
|
+
documentObject.removeEventListener("touchstart", onPointerDown, true);
|
|
1326
|
+
documentObject.removeEventListener("touchend", onTouchEnd, true);
|
|
1325
1327
|
};
|
|
1326
1328
|
}
|
|
1327
1329
|
}, [
|
package/dist/main.js
CHANGED
|
@@ -1316,6 +1316,8 @@ function $edcfa848c42f94f4$export$872b660ac5a1ff98(props) {
|
|
|
1316
1316
|
(0, $goTMa$react.useEffect)(()=>{
|
|
1317
1317
|
let state = stateRef.current;
|
|
1318
1318
|
if (isDisabled) return;
|
|
1319
|
+
const element = ref.current;
|
|
1320
|
+
const documentObject = (0, $goTMa$reactariautils.getOwnerDocument)(element);
|
|
1319
1321
|
// Use pointer events if available. Otherwise, fall back to mouse and touch events.
|
|
1320
1322
|
if (typeof PointerEvent !== "undefined") {
|
|
1321
1323
|
let onPointerUp = (e)=>{
|
|
@@ -1323,11 +1325,11 @@ function $edcfa848c42f94f4$export$872b660ac5a1ff98(props) {
|
|
|
1323
1325
|
state.isPointerDown = false;
|
|
1324
1326
|
};
|
|
1325
1327
|
// changing these to capture phase fixed combobox
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
+
documentObject.addEventListener("pointerdown", onPointerDown, true);
|
|
1329
|
+
documentObject.addEventListener("pointerup", onPointerUp, true);
|
|
1328
1330
|
return ()=>{
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
+
documentObject.removeEventListener("pointerdown", onPointerDown, true);
|
|
1332
|
+
documentObject.removeEventListener("pointerup", onPointerUp, true);
|
|
1331
1333
|
};
|
|
1332
1334
|
} else {
|
|
1333
1335
|
let onMouseUp = (e)=>{
|
|
@@ -1340,15 +1342,15 @@ function $edcfa848c42f94f4$export$872b660ac5a1ff98(props) {
|
|
|
1340
1342
|
if (state.isPointerDown && $edcfa848c42f94f4$var$isValidEvent(e, ref)) triggerInteractOutside(e);
|
|
1341
1343
|
state.isPointerDown = false;
|
|
1342
1344
|
};
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1345
|
+
documentObject.addEventListener("mousedown", onPointerDown, true);
|
|
1346
|
+
documentObject.addEventListener("mouseup", onMouseUp, true);
|
|
1347
|
+
documentObject.addEventListener("touchstart", onPointerDown, true);
|
|
1348
|
+
documentObject.addEventListener("touchend", onTouchEnd, true);
|
|
1347
1349
|
return ()=>{
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1350
|
+
documentObject.removeEventListener("mousedown", onPointerDown, true);
|
|
1351
|
+
documentObject.removeEventListener("mouseup", onMouseUp, true);
|
|
1352
|
+
documentObject.removeEventListener("touchstart", onPointerDown, true);
|
|
1353
|
+
documentObject.removeEventListener("touchend", onTouchEnd, true);
|
|
1352
1354
|
};
|
|
1353
1355
|
}
|
|
1354
1356
|
}, [
|