@@ -4,8 +4,10 @@ What a `Dialog`, a `Popover` — and everything built on them: `Popup`,
44` SidePanel ` , a ` Picker ` 's popup — lays between itself and the page it opened
55over.
66
7- It answers two questions, and they are independent:
7+ It answers three questions, and they are independent:
88
9+ 0 . ** Is there anything between the popup and the page at all?** That is
10+ ` backdrop ` .
9111 . ** What does a press outside do?** Close, cancel, be absorbed, pass through.
1012 That is ` pointerInteractionOutsideEffect ` .
11132 . ** How far does what is behind withdraw?** Dimmed, blurred, barely marked,
@@ -15,7 +17,54 @@ It answers two questions, and they are independent:
1517Keeping them apart is the whole point of this page. A popup that must close on
1618an outside click — because that click is the way out of the screen — may also
1719need the page behind to stop competing for the eye. How much it withdraws says
18- nothing about what the click does.
20+ nothing about what the click does, and neither says whether the page behind is
21+ still reachable.
22+
23+ ## Is there a backdrop at all
24+
25+ A backdrop is a wall: a full-screen element in front of the page, which wins
26+ hit-testing. That is how it absorbs a press — not by handling the event and
27+ stopping it, but by being what the pointer hits. Nothing behind it hears
28+ anything.
29+
30+ So a popup that closes on an outside press spends that press: the first press
31+ dismisses, and a second one is needed to do the thing the user was already
32+ pointing at. That is right when the page has withdrawn — the dim says the page
33+ is off, and a press on it means "come back", nothing more.
34+
35+ It is wrong when nothing withdrew. A bubble opened over a map, a plan, a canvas
36+ — a page that looks exactly as pressable as it did a second ago — makes the
37+ next press a natural continuation of the gesture, not a dismissal. Taking it to
38+ close the bubble spends it on something the user never asked for, and on a page
39+ that gave no sign it would.
40+
41+ ` backdrop={false} ` is how that popup says there is no wall:
42+
43+ ``` jsx
44+ < Popover pointerInteractionOutsideEffect= " close" backdrop= {false }>
45+ ```
46+
47+ The popup then hears an outside press from the document itself, and takes
48+ nothing from it: no ` preventDefault ` , no ` stopPropagation ` . It closes, and the
49+ same press is answered by whatever it landed on — one gesture, one press.
50+
51+ ** It is not ` backdropVariant="invisible" ` .** A wall that is not painted is
52+ still a wall, and it still eats the press; the two props answer different
53+ questions. ` "invisible" ` is for a popup that must absorb — a menu whose
54+ dismissing click must not also press what is under it — without dimming the
55+ page for it. ` backdrop={false} ` is for a popup that must not absorb at all.
56+
57+ ** Only a non-modal popup can honour it.** ` Popover ` always can, either layer. A
58+ ` Dialog ` can only in ` layer="local" ` : the default ` layer="top" ` is shown with
59+ ` showModal() ` , which makes everything behind genuinely inert before any of
60+ navi's code runs — there is no press left to let through, and asking for one
61+ warns. ` Popup ` follows from that: it forwards ` backdrop ` to its popover and
62+ drops it for a top-layer dialog, so the same usage that gives one press on a
63+ desktop costs two once the small-screen resolution picks dialog mode.
64+
65+ ` pointerInteractionOutsideEffect="capture" ` and ` backdrop={false} ` contradict
66+ each other — absorbing is what a wall does — and navi warns rather than
67+ silently behaving like ` "none" ` .
1968
2069## Where the outside begins
2170
@@ -115,7 +164,8 @@ closes on an outside click blurs too.
115164
116165` backdropVariant ` is the shorthand for the other direction: ` "discrete" ` for a
117166barely-there dim, ` "invisible" ` for no paint at all. It never changes what the
118- outside click does — the backdrop is still there and still catches it.
167+ outside click does — the wall is still there and still catches it. Whether
168+ there is a wall to paint is ` backdrop ` , above.
119169
120170` "invisible" ` is the one kind with no filter token: it paints nothing, and a
121171filter would still be seen.
0 commit comments