Skip to content

Tabster crashes in Firefox #381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
petewu100 opened this issue Apr 4, 2024 · 1 comment
Open

Tabster crashes in Firefox #381

petewu100 opened this issue Apr 4, 2024 · 1 comment

Comments

@petewu100
Copy link

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.

@ling1726
Copy link
Member

ling1726 commented Apr 8, 2024

@petewu100 can you provide a repro for this? Trying to call getAttribute on Firefox I can't see that getAttribute is undefined

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants