Expose API for detecting the active layer

Description

Currently, products use internal implementation of AUI to know whether a dialog or other layer is active, e.g. by looking for aui-blanket or the following code:

It has a few drawbacks at least:

  • it can be error prone (the logic itself & when upgrading AUI)

  • increased code complexity

  • code duplication

  • promoting global variables

AUI could expose and document an API method which satisfy the following:

  • is available via AMD module

  • offers a simple check: whether is there any active/focused layered opened : boolean

  • e.g. returns true when a dialog is opened

  • e.g. returns true when a dropdown menu is opened and the focus is on it or within it

  • e.g. returns false when a dropdown menu is opened, but the focus is on other element

Stretch goal: returning a name of a top layer (e.g. dropdown) to be able to differentiate layers.

Environment

None

QA Kickoff Check-In

Usage described in documentation
Demonstration of all states
Interactive state (screen readers)
Visual regression tests
Unit tests
Navigation (only keyboard / only mouse)
Component render legibly

QA Demo Check-Out

P2 plugin
Browsers (Edge/IE11/Firefox/Chrome/Safari)
Resizing
Zoom in/out
Navigation (Keyboard/Mouse)
Focus
Element status (At Rest/Pressed/Selected/Read Only/Disabled)
Cursors
Tooltips
Audio

Activity

Show:
Michal Samujlo
September 23, 2020, 11:34 AM

which of the things requested can’t be done by Jira at the moment? I’d like to understand how important is this task.

Assignee

Unassigned

Reporter

Maciej Rzymski

Labels

Changelog entry text

None

Needs Doc

None

Epic Link

Components

Fix versions

Priority

Major
Configure