@brightspace-ui/core 3.155.3 → 3.155.5
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.
@@ -1,7 +1,6 @@
|
|
1
1
|
import { getFirstFocusableDescendant, getLastFocusableDescendant, getNextFocusable, getPreviousFocusable } from '../../helpers/focus.js';
|
2
2
|
import { CollectionMixin } from '../../mixins/collection/collection-mixin.js';
|
3
3
|
import { isComposedAncestor } from '../../helpers/dom.js';
|
4
|
-
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
5
4
|
|
6
5
|
const keyCodes = {
|
7
6
|
DOWN: 40,
|
@@ -50,7 +49,7 @@ export class SelectionInfo {
|
|
50
49
|
|
51
50
|
}
|
52
51
|
|
53
|
-
export const SelectionMixin = superclass => class extends
|
52
|
+
export const SelectionMixin = superclass => class extends CollectionMixin(superclass) {
|
54
53
|
|
55
54
|
static get properties() {
|
56
55
|
return {
|
@@ -193,7 +192,8 @@ export const SelectionMixin = superclass => class extends RtlMixin(CollectionMix
|
|
193
192
|
}
|
194
193
|
};
|
195
194
|
|
196
|
-
const
|
195
|
+
const isRtl = (document.documentElement.getAttribute('dir') === 'rtl');
|
196
|
+
const forward = (!isRtl && e.keyCode === keyCodes.RIGHT) || (isRtl && e.keyCode === keyCodes.LEFT) || (e.keyCode === keyCodes.DOWN);
|
197
197
|
|
198
198
|
// first try to find next/previous selection-input relative to the event target within the selection component sub-tree that also belongs to the selection component
|
199
199
|
let focusable = forward ? getNextFocusable(target, false, true, true) : getPreviousFocusable(target, false, true, true);
|
package/helpers/focus.js
CHANGED
@@ -42,9 +42,8 @@ export function getFirstFocusableDescendant(node, includeHidden, predicate = ()
|
|
42
42
|
}
|
43
43
|
|
44
44
|
export function getFirstFocusableRelative(node, { includeHidden, predicate = () => true, includeTabbablesOnly, nodeVisibilityUnknown = true } = {}) {
|
45
|
-
if (!node) return null;
|
46
|
-
|
47
45
|
if (!includeHidden && nodeVisibilityUnknown) node = getFirstVisibleAncestor(node);
|
46
|
+
if (!node) return null;
|
48
47
|
|
49
48
|
if (isFocusable(node, true) && predicate(node)) return node;
|
50
49
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.155.
|
3
|
+
"version": "3.155.5",
|
4
4
|
"description": "A collection of accessible, free, open-source web components for building Brightspace applications",
|
5
5
|
"type": "module",
|
6
6
|
"repository": "https://github.com/BrightspaceUI/core.git",
|