Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AxFocusFixDirective

whatitdoes

This makes the Chrome accesibility audit pass for AX_FOCUS_01.

------------------------------------------

  • It seems that the Chrome accesibility audit does not pass any items that are fixed, even if they are visible and clickable.
  • If this turns out to be a bug with Chrome, then this directive will need to be replaced with one that simply marks elements as aria-hidden="true" when they are not visible or clickable.

Hierarchy

  • AxFocusFixDirective

Implements

  • OnDestroy
  • OnInit

Index

Constructors

constructor

Properties

ariaHidden

ariaHidden: boolean

Sets the aria-hidden attribute of the host element.

Private document

document: Document

the global document variable

Private el

el: ElementRef

a reference to the host element

Private globalEventsService

globalEventsService: GlobalEventsService

Private router

router: Router

used to listen to the current route

routerSubscription

routerSubscription: Subscription

A reference to the router subscription created in skipIfHome.

scrollSubscription

scrollSubscription: Subscription

A reference to the scroll subscription created in ngOnInit.

skipRoute

skipRoute: boolean

This directive will not affect skipped routes.

Private window

window: Window

the global window variable

Methods

ngOnDestroy

  • ngOnDestroy(): void

ngOnInit

  • ngOnInit(): void

Private onKeyDown

  • onKeyDown(event: KeyboardEvent): void

Private onKeyUp

  • onKeyUp(event: KeyboardEvent): void
  • On tab keyup, If: the host element is not focused, then set it to hidden for screen readers Otherwise: scroll to the top of the page.

    Parameters

    • event: KeyboardEvent

      the keyup event object

      • the KeyboardEvent keyCode 9 is for tab

    Returns void

Private onScroll

  • onScroll(): void

Private setHidden

  • setHidden(newValue: boolean): void

Private skipIfHome

  • skipIfHome(): void

Generated using TypeDoc