adobe / adobe/focus-ring-polyfill
Event target in blur handler does not always have a classList in Firefox
- Dominant language
- JavaScript
- Stars
- 5
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
In Firefox the `onBlurHandler` is called on the document when it loses focus. The HTMLDocument does not have a `classList` property, and so an error gets thrown
**To Reproduce**
Steps to reproduce the behavior:
1. In Firefox, go to https://xd.adobe.com/view/c78d5f92-5a79-43a4-6c32-219b18423a7c-b1bc/
2. Open the console
3. Notice `TypeError: e.target.classList is undefined`. If you enable Pause on exceptions you can see that the target is the HTMLDocument
**Expected behavior**
No errors
**Screenshots**

**Desktop (please complete the following information):**
- OS: macOS 10.12.6
- Browser: Firefox Developer Edition, 61.0b8 (64-bit)
- Version [e.g. 22]
**Additional context**
This is our number 1 occurring error on xd.adobe.com prototypes at the moment.
Contributor guide
Research direction
Start by locating the onBlurHandler mentioned in the report and reproduce the Firefox case using the linked Adobe XD prototype, watching for the document as the event target. The fix is done when the blur path produces no classList TypeError when focus leaves the document.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- accessibility, frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100