Skip to content

Explore tracking node focus with classname #1509

Open
@interactivellama

Description

@interactivellama

Let's face it...writing a Mocha test that finds the node with the global focus of a document is a nightmare. PhantomJS intermittently fails and you have to restart TravisCI a few times a week due to unrelated tests that fail.

What if there was a classname...say .slds-focused or something like that which could be queried to find focus, then documentElement wouldn't have to be referenced. When the component controls focus (such as left and right arrows in a pill box), focus is set by the view-model itself on render anyway. When the user interacts with the UI (such as a mouse click), this is a different story however, since the DOM is setting focus itself and not the internal view-model, so this class would only be used by view-model-derived focus which would typically be what tests would test--we don't need to test if the browser works.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions