microsoft / microsoft/tabster

Tabster crashes in Firefox

Open
#381 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
165
Forks
42
Avg merge
1d 11h
Merged PRs (30d)
9

Description

When pressing Tab in a web app that uses Tabster in Firefox, I hit a crash in the following code in Focusable.ts:

private _isHidden(el: HTMLElement): boolean {
    const attrVal = el.getAttribute("aria-hidden");

    if (attrVal && attrVal.toLowerCase() === "true") {
        if (!this._tabster.modalizer?.isAugmented(el)) {
            return true;
        }
    }

    return false;
}

The loop in isAccessible proceeds all the up the DOM to the HTMLDocument element and el.getAttribute is not defined for the HTMLDocument element so it crashes on the first line of _isHidden. Seems like the code should check if el.getAttribute is defined before trying to call it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Focusable.ts at _isHidden and reproduce the crash by pressing Tab in a Firefox web app using Tabster. Trace isAccessible as it reaches the HTMLDocument element, then verify that the same navigation no longer crashes and that normal aria-hidden handling still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
accessibility, frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.