@jsenv/navi 0.29.221 → 0.29.222
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/dev/jsenv_navi.js +34 -13
- package/dist/dev/jsenv_navi.js.map +3 -3
- package/dist/jsenv_navi.js +34 -13
- package/dist/jsenv_navi.js.map +3 -3
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -45653,15 +45653,27 @@ const handlePressOnOutsideRegion = (
|
|
|
45653
45653
|
* answers it. The one popup where that cannot hold is the modal dialog, where
|
|
45654
45654
|
* the browser has already made everything behind inert before this runs.
|
|
45655
45655
|
*
|
|
45656
|
-
* `
|
|
45657
|
-
*
|
|
45658
|
-
*
|
|
45659
|
-
*
|
|
45660
|
-
*
|
|
45661
|
-
*
|
|
45662
|
-
*
|
|
45663
|
-
* it
|
|
45664
|
-
*
|
|
45656
|
+
* `pressEventType` says which event IS the press, and the two callers want
|
|
45657
|
+
* opposite ones:
|
|
45658
|
+
*
|
|
45659
|
+
* - `"pointerdown"` for a popup with no wall: a page with no wall over it is
|
|
45660
|
+
* a page whose own elements arbitrate their presses, and cancelling a
|
|
45661
|
+
* `pointerdown` — what a drag source and a control keeping the focus where
|
|
45662
|
+
* it is both do — suppresses every compatibility mouse event that would have
|
|
45663
|
+
* followed it. The press happens, reaches its target, and no `mousedown` is
|
|
45664
|
+
* ever dispatched for it. Reading the pointer event is reading the press
|
|
45665
|
+
* itself, whatever anything does with it afterwards, and it is the same
|
|
45666
|
+
* event the drag and surface detectors read.
|
|
45667
|
+
* - `"mousedown"` for the modal dialog, whose native `::backdrop` exists to
|
|
45668
|
+
* spend the press. The page's controls act on `mousedown`, and on a touch
|
|
45669
|
+
* screen that is not the same moment as `pointerdown`: the compatibility
|
|
45670
|
+
* mouse events are synthesized at `touchend` and hit-tested again then.
|
|
45671
|
+
* Closing on `pointerdown` takes the `::backdrop` away before that second
|
|
45672
|
+
* hit-test, so the `mousedown` lands on whatever the page holds under the
|
|
45673
|
+
* finger, and one tap both dismisses the dialog and presses the page. Read
|
|
45674
|
+
* on `mousedown`, the wall is still up when the press the page acts on is
|
|
45675
|
+
* aimed, and it catches it. Nothing behind a modal wall can cancel that
|
|
45676
|
+
* press, since nothing behind it hears the `pointerdown` at all.
|
|
45665
45677
|
*
|
|
45666
45678
|
* Capture phase, so a handler downstream that stops propagation cannot keep
|
|
45667
45679
|
* the popup open either — the press is still outside whatever is made of it.
|
|
@@ -45670,7 +45682,11 @@ const handlePressOnOutsideRegion = (
|
|
|
45670
45682
|
*/
|
|
45671
45683
|
const armOutsidePressClose = (
|
|
45672
45684
|
popupEl,
|
|
45673
|
-
{
|
|
45685
|
+
{
|
|
45686
|
+
openController,
|
|
45687
|
+
pointerInteractionOutsideEffect,
|
|
45688
|
+
pressEventType = "pointerdown",
|
|
45689
|
+
},
|
|
45674
45690
|
) => {
|
|
45675
45691
|
const onDocumentPointerDown = (pointerDownEvent) => {
|
|
45676
45692
|
if (pointerDownEvent.button !== 0) {
|
|
@@ -45727,11 +45743,11 @@ const armOutsidePressClose = (
|
|
|
45727
45743
|
isCancel: pointerInteractionOutsideEffect === "cancel",
|
|
45728
45744
|
});
|
|
45729
45745
|
};
|
|
45730
|
-
document.addEventListener(
|
|
45746
|
+
document.addEventListener(pressEventType, onDocumentPointerDown, {
|
|
45731
45747
|
capture: true,
|
|
45732
45748
|
});
|
|
45733
45749
|
return () => {
|
|
45734
|
-
document.removeEventListener(
|
|
45750
|
+
document.removeEventListener(pressEventType, onDocumentPointerDown, {
|
|
45735
45751
|
capture: true,
|
|
45736
45752
|
});
|
|
45737
45753
|
};
|
|
@@ -58815,7 +58831,12 @@ const useDialogProps = props => {
|
|
|
58815
58831
|
if ((isModal || !backdrop) && (pointerInteractionOutsideEffect === "close" || pointerInteractionOutsideEffect === "cancel")) {
|
|
58816
58832
|
addCleanup(armOutsidePressClose(dialogEl, {
|
|
58817
58833
|
openController,
|
|
58818
|
-
pointerInteractionOutsideEffect
|
|
58834
|
+
pointerInteractionOutsideEffect,
|
|
58835
|
+
// A modal wall spends the press the page acts on (mousedown); a
|
|
58836
|
+
// local dialog with no wall lets that same press through
|
|
58837
|
+
// (pointerdown). See armOutsidePressClose for why the two differ on
|
|
58838
|
+
// a touch screen.
|
|
58839
|
+
pressEventType: isModal ? "mousedown" : "pointerdown"
|
|
58819
58840
|
}));
|
|
58820
58841
|
}
|
|
58821
58842
|
return closeEvent => {
|