@vaadin/a11y-base 24.5.0-alpha6 → 24.5.0-alpha8
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/a11y-base",
|
|
3
|
-
"version": "24.5.0-
|
|
3
|
+
"version": "24.5.0-alpha8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
34
34
|
"@polymer/polymer": "^3.0.0",
|
|
35
|
-
"@vaadin/component-base": "24.5.0-
|
|
35
|
+
"@vaadin/component-base": "24.5.0-alpha8",
|
|
36
36
|
"lit": "^3.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@
|
|
40
|
-
"@vaadin/testing-helpers": "^0.
|
|
41
|
-
"sinon": "^
|
|
39
|
+
"@vaadin/chai-plugins": "24.5.0-alpha8",
|
|
40
|
+
"@vaadin/testing-helpers": "^1.0.0",
|
|
41
|
+
"sinon": "^18.0.0"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "1e227aaa55df3f5dae3d477b9afb5fce4f5ece33"
|
|
44
44
|
}
|
|
@@ -23,20 +23,22 @@ export class FocusRestorationController {
|
|
|
23
23
|
/**
|
|
24
24
|
* Restores focus to the target node that was saved previously with `saveFocus()`.
|
|
25
25
|
*/
|
|
26
|
-
restoreFocus() {
|
|
26
|
+
restoreFocus(options) {
|
|
27
27
|
const focusNode = this.focusNode;
|
|
28
28
|
if (!focusNode) {
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
const preventScroll = options ? options.preventScroll : false;
|
|
33
|
+
|
|
32
34
|
if (getDeepActiveElement() === document.body) {
|
|
33
35
|
// In Firefox and Safari, focusing the node synchronously
|
|
34
36
|
// doesn't work as expected when the overlay is closing on outside click.
|
|
35
37
|
// These browsers force focus to move to the body element and retain it
|
|
36
38
|
// there until the next event loop iteration.
|
|
37
|
-
setTimeout(() => focusNode.focus());
|
|
39
|
+
setTimeout(() => focusNode.focus({ preventScroll }));
|
|
38
40
|
} else {
|
|
39
|
-
focusNode.focus();
|
|
41
|
+
focusNode.focus({ preventScroll });
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
this.focusNode = null;
|