@reshaped/utilities 4.2.0-canary.0 → 4.2.0
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/a11y/focus.js +2 -1
- package/package.json +1 -1
package/dist/a11y/focus.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getShadowRoot } from "../dom";
|
|
2
|
+
import { checkKeyboardMode } from "./keyboardMode";
|
|
2
3
|
const pseudoFocusAttribute = "data-rs-focus";
|
|
3
4
|
export const focusableSelector = 'a,button,input:not([type="hidden"]),textarea,select,details,[tabindex],[contenteditable]';
|
|
4
5
|
export const getActiveElement = (originEl) => {
|
|
@@ -15,7 +16,7 @@ export const focusElement = (el, options) => {
|
|
|
15
16
|
el.setAttribute(pseudoFocusAttribute, "true");
|
|
16
17
|
}
|
|
17
18
|
else {
|
|
18
|
-
el.focus();
|
|
19
|
+
el.focus({ preventScroll: !checkKeyboardMode() });
|
|
19
20
|
}
|
|
20
21
|
};
|
|
21
22
|
export const getFocusableElements = (rootEl, options) => {
|