@zag-js/popover 0.0.0-dev-20230518233711 → 0.0.0-dev-20230523135722
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.
|
@@ -168,6 +168,7 @@ function machine(userContext) {
|
|
|
168
168
|
trap = createFocusTrap(el, {
|
|
169
169
|
escapeDeactivates: false,
|
|
170
170
|
allowOutsideClick: true,
|
|
171
|
+
preventScroll: true,
|
|
171
172
|
returnFocusOnDeactivate: true,
|
|
172
173
|
document: dom.getDoc(ctx2),
|
|
173
174
|
fallbackFocus: el,
|
|
@@ -202,14 +203,14 @@ function machine(userContext) {
|
|
|
202
203
|
},
|
|
203
204
|
setInitialFocus(ctx2) {
|
|
204
205
|
raf(() => {
|
|
205
|
-
dom.getInitialFocusEl(ctx2)?.focus();
|
|
206
|
+
dom.getInitialFocusEl(ctx2)?.focus({ preventScroll: true });
|
|
206
207
|
});
|
|
207
208
|
},
|
|
208
209
|
restoreFocusIfNeeded(ctx2, evt) {
|
|
209
210
|
if (!evt.restoreFocus)
|
|
210
211
|
return;
|
|
211
212
|
raf(() => {
|
|
212
|
-
dom.getTriggerEl(ctx2)?.focus();
|
|
213
|
+
dom.getTriggerEl(ctx2)?.focus({ preventScroll: true });
|
|
213
214
|
});
|
|
214
215
|
},
|
|
215
216
|
invokeOnOpen(ctx2) {
|
package/dist/index.js
CHANGED
|
@@ -348,6 +348,7 @@ function machine(userContext) {
|
|
|
348
348
|
trap = (0, import_focus_trap.createFocusTrap)(el, {
|
|
349
349
|
escapeDeactivates: false,
|
|
350
350
|
allowOutsideClick: true,
|
|
351
|
+
preventScroll: true,
|
|
351
352
|
returnFocusOnDeactivate: true,
|
|
352
353
|
document: dom.getDoc(ctx2),
|
|
353
354
|
fallbackFocus: el,
|
|
@@ -382,14 +383,14 @@ function machine(userContext) {
|
|
|
382
383
|
},
|
|
383
384
|
setInitialFocus(ctx2) {
|
|
384
385
|
(0, import_dom_query3.raf)(() => {
|
|
385
|
-
dom.getInitialFocusEl(ctx2)?.focus();
|
|
386
|
+
dom.getInitialFocusEl(ctx2)?.focus({ preventScroll: true });
|
|
386
387
|
});
|
|
387
388
|
},
|
|
388
389
|
restoreFocusIfNeeded(ctx2, evt) {
|
|
389
390
|
if (!evt.restoreFocus)
|
|
390
391
|
return;
|
|
391
392
|
(0, import_dom_query3.raf)(() => {
|
|
392
|
-
dom.getTriggerEl(ctx2)?.focus();
|
|
393
|
+
dom.getTriggerEl(ctx2)?.focus({ preventScroll: true });
|
|
393
394
|
});
|
|
394
395
|
},
|
|
395
396
|
invokeOnOpen(ctx2) {
|
package/dist/index.mjs
CHANGED
package/dist/popover.machine.js
CHANGED
|
@@ -226,6 +226,7 @@ function machine(userContext) {
|
|
|
226
226
|
trap = (0, import_focus_trap.createFocusTrap)(el, {
|
|
227
227
|
escapeDeactivates: false,
|
|
228
228
|
allowOutsideClick: true,
|
|
229
|
+
preventScroll: true,
|
|
229
230
|
returnFocusOnDeactivate: true,
|
|
230
231
|
document: dom.getDoc(ctx2),
|
|
231
232
|
fallbackFocus: el,
|
|
@@ -260,14 +261,14 @@ function machine(userContext) {
|
|
|
260
261
|
},
|
|
261
262
|
setInitialFocus(ctx2) {
|
|
262
263
|
(0, import_dom_query2.raf)(() => {
|
|
263
|
-
dom.getInitialFocusEl(ctx2)?.focus();
|
|
264
|
+
dom.getInitialFocusEl(ctx2)?.focus({ preventScroll: true });
|
|
264
265
|
});
|
|
265
266
|
},
|
|
266
267
|
restoreFocusIfNeeded(ctx2, evt) {
|
|
267
268
|
if (!evt.restoreFocus)
|
|
268
269
|
return;
|
|
269
270
|
(0, import_dom_query2.raf)(() => {
|
|
270
|
-
dom.getTriggerEl(ctx2)?.focus();
|
|
271
|
+
dom.getTriggerEl(ctx2)?.focus({ preventScroll: true });
|
|
271
272
|
});
|
|
272
273
|
},
|
|
273
274
|
invokeOnOpen(ctx2) {
|
package/dist/popover.machine.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/popover",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20230523135722",
|
|
4
4
|
"description": "Core logic for the popover widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -27,16 +27,16 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"focus-trap": "7.4.1",
|
|
30
|
-
"@zag-js/anatomy": "0.0.0-dev-
|
|
31
|
-
"@zag-js/aria-hidden": "0.0.0-dev-
|
|
32
|
-
"@zag-js/core": "0.0.0-dev-
|
|
33
|
-
"@zag-js/dom-query": "0.0.0-dev-
|
|
34
|
-
"@zag-js/utils": "0.0.0-dev-
|
|
35
|
-
"@zag-js/dismissable": "0.0.0-dev-
|
|
36
|
-
"@zag-js/tabbable": "0.0.0-dev-
|
|
37
|
-
"@zag-js/popper": "0.0.0-dev-
|
|
38
|
-
"@zag-js/remove-scroll": "0.0.0-dev-
|
|
39
|
-
"@zag-js/types": "0.0.0-dev-
|
|
30
|
+
"@zag-js/anatomy": "0.0.0-dev-20230523135722",
|
|
31
|
+
"@zag-js/aria-hidden": "0.0.0-dev-20230523135722",
|
|
32
|
+
"@zag-js/core": "0.0.0-dev-20230523135722",
|
|
33
|
+
"@zag-js/dom-query": "0.0.0-dev-20230523135722",
|
|
34
|
+
"@zag-js/utils": "0.0.0-dev-20230523135722",
|
|
35
|
+
"@zag-js/dismissable": "0.0.0-dev-20230523135722",
|
|
36
|
+
"@zag-js/tabbable": "0.0.0-dev-20230523135722",
|
|
37
|
+
"@zag-js/popper": "0.0.0-dev-20230523135722",
|
|
38
|
+
"@zag-js/remove-scroll": "0.0.0-dev-20230523135722",
|
|
39
|
+
"@zag-js/types": "0.0.0-dev-20230523135722"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"clean-package": "2.2.0"
|