Skip to content

Commit 0a6057c

Browse files
committed
refactor: pr feedback
1 parent cdc79e6 commit 0a6057c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/behaviors/focusZone.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,19 @@ function shouldIgnoreFocusHandling(keyboardEvent: KeyboardEvent, activeElement:
313313
}
314314

315315
export const isActiveDescendantAttribute = 'data-is-active-descendant'
316+
/**
317+
* A value of activated-directly for data-is-active-descendant indicates the descendant was activated
318+
* by a manual user interaction with intent to move active descendant. This usually translates to the
319+
* user pressing one of the bound keys (up/down arrow, etc) to move through the focus zone. This is
320+
* intended to be roughly equivalent to the :focus-visible pseudo-class
321+
**/
316322
export const activeDescendantActivatedDirectly = 'activated-directly'
323+
/**
324+
* A value of activated-indirectly for data-is-active-descendant indicates the descendant was activated
325+
* implicitly, and not by a direct key press. This includes focus zone being created from scratch, focusable
326+
* elements being added/removed, and mouseover events. This is intended to be roughly equivalent
327+
* to :focus:not(:focus-visible)
328+
**/
317329
export const activeDescendantActivatedIndirectly = 'activated-indirectly'
318330
export const hasActiveDescendantAttribute = 'data-has-active-descendant'
319331

@@ -512,7 +524,7 @@ export function focusZone(container: HTMLElement, settings?: FocusZoneSettings):
512524
container.addEventListener(
513525
'mousemove',
514526
({target}) => {
515-
if (!(target instanceof HTMLElement)) {
527+
if (!(target instanceof Node)) {
516528
return
517529
}
518530

0 commit comments

Comments
 (0)